* examples/gtkcrc.py:
* morituri/common/crc.py: * morituri/common/task.py: * morituri/image/image.py: Add a 'schedule' call to the TaskRunner class, so that we can abstract things like gobject.timeout_add and reactor.callLater Pass the runner to the task in Task.start() so a task can call schedule.
This commit is contained in:
@@ -55,7 +55,13 @@ class TaskProgress(gtk.VBox, task.TaskRunner):
|
||||
task.addListener(self)
|
||||
while gtk.events_pending():
|
||||
gtk.main_iteration()
|
||||
task.start()
|
||||
task.start(self)
|
||||
|
||||
def schedule(self, delta, callable, *args, **kwargs):
|
||||
def c():
|
||||
callable(*args, **kwargs)
|
||||
return False
|
||||
gobject.timeout_add(int(delta * 1000L), c)
|
||||
|
||||
def started(self, task):
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user