This commit is contained in:
Kovid Goyal 2011-06-12 08:22:52 -06:00
parent 2b4e1d8608
commit ee04420a2e

View File

@ -38,6 +38,10 @@ class DeviceJob(BaseJob): # {{{
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,6 +263,7 @@ class DeviceManager(Thread): # {{{
job = self.next()
if job is not None:
self.current_job = job
if self.device is not None:
self.device.set_progress_reporter(job.report_progress)
self.current_job.run()
self.current_job = None