mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-01-20 14:15:15 +01:00
...
This commit is contained in:
parent
2b4e1d8608
commit
ee04420a2e
1 changed files with 6 additions and 1 deletions
|
|
@ -38,6 +38,10 @@ def __init__(self, func, done, job_manager, args=[], kwargs={},
|
|||
BaseJob.__init__(self, description)
|
||||
self.func = func
|
||||
self.callback_on_done = done
|
||||
if not isinstance(self.callback_on_done, (Dispatcher,
|
||||
FunctionDispatcher)):
|
||||
self.callback_on_done = FunctionDispatcher(self.callback_on_done)
|
||||
|
||||
self.args, self.kwargs = args, kwargs
|
||||
self.exception = None
|
||||
self.job_manager = job_manager
|
||||
|
|
@ -259,7 +263,8 @@ def run(self):
|
|||
job = self.next()
|
||||
if job is not None:
|
||||
self.current_job = job
|
||||
self.device.set_progress_reporter(job.report_progress)
|
||||
if self.device is not None:
|
||||
self.device.set_progress_reporter(job.report_progress)
|
||||
self.current_job.run()
|
||||
self.current_job = None
|
||||
else:
|
||||
|
|
|
|||
Loading…
Reference in a new issue