'A job that is run in its own thread in the calibre main process
:param type_: The type of this job (a string). The type is used in
conjunction with max_concurrent_count to prevent too many jobs of the
same type from running
:param description: A user viewable job description
:func: The function that actually does the work. This function *must*
accept at least three keyword arguments: abort, log and notifications. abort is
An Event object. func should periodically check abort.is_set() and if
it is True, it should stop processing as soon as possible. notifications
is a Queue. func should put progress notifications into it in the form
of a tuple (frac, msg). frac is a number between 0 and 1 indicating
progress and msg is a string describing the progress. log is a Log
object which func should use for all debugging output. func should
raise an Exception to indicate failure. This exception is stored in
job.exception and can thus be used to pass arbitrary information to
callback.
:param args,kwargs: These are passed to func when it is called
:param callback: A callable that is called on completion of this job.
Note that it is not called if the user kills the job. Check job.failed
to see if the job succeeded or not. And use job.log to get the job log.
:param killable: If False the GUI wont let the user kill this job
:param log: Must be a subclass of GUILog or None. If None a default
GUILog is created.'

def __init__(self, type_, description, func, args, kwargs, callback, max_concurrent_count=1, killable=True, log=None):

    BaseJob.__init__(self, description)
    self.type = type_
    self.max_concurrent_count = max_concurrent_count
    self.killable = killable
    self.callback = callback
    self.abort = Event()
    self.exception = None
    kwargs[u'notifications'] = self.notifications
    kwargs[u'abort'] = self.abort
    self.log = (GUILog() if (log is None) else log)
    kwargs[u'log'] = self.log
    (self.func, self.args, self.kwargs) = (func, args, kwargs)
    self.consolidated_log = None
