* 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:
Thomas Vander Stichele
2009-04-12 08:51:13 +00:00
parent 10647d18a1
commit f1d75142da
5 changed files with 52 additions and 14 deletions

View File

@@ -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