[SCM] morituri/master: * morituri/common/task.py: Schedule the start from the main loop, otherwise the task might complete before we're in the main loop, and then the loop.quit() doesn't work.

js at users.alioth.debian.org js at users.alioth.debian.org
Sun Oct 19 20:08:45 UTC 2014


The following commit has been merged in the master branch:
commit b7eb47325e321fceb684fc069f8d0379240f09ec
Author: Thomas Vander Stichele <thomas (at) apestaart (dot) org>
Date:   Sun Apr 12 10:18:56 2009 +0000

    	* morituri/common/task.py:
    	  Schedule the start from the main loop, otherwise the
    	  task might complete before we're in the main loop,
    	  and then the loop.quit() doesn't work.

diff --git a/ChangeLog b/ChangeLog
index 27506d1..dce906b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2009-04-12  Thomas Vander Stichele  <thomas at apestaart dot org>
 
+	* morituri/common/task.py:
+	  Schedule the start from the main loop, otherwise the
+	  task might complete before we're in the main loop,
+	  and then the loop.quit() doesn't work.
+
+2009-04-12  Thomas Vander Stichele  <thomas at apestaart dot org>
+
 	* examples/ARcue.py:
 	* examples/gtkcrc.py:
 	  Rework both examples to look more similar.
diff --git a/morituri/common/task.py b/morituri/common/task.py
index 275b36f..2bcb38c 100644
--- a/morituri/common/task.py
+++ b/morituri/common/task.py
@@ -169,7 +169,9 @@ class SyncRunner(TaskRunner):
 
         self._loop = gobject.MainLoop()
         self._task.addListener(self)
-        self._task.start(self)
+        # only start the task after going into the mainloop,
+        # otherwise the task might complete before we are in it
+        gobject.timeout_add(0L, self._task.start, self)
         self._loop.run()
 
     def schedule(self, delta, callable, *args, **kwargs):
@@ -242,6 +244,7 @@ class GtkProgressRunner(gtk.VBox, TaskRunner):
         # self._task.removeListener(self)
 
     def progressed(self, task, value):
+        self._label.set_text(task.description)
         self._progress.set_fraction(value)
 
 

-- 
morituri packaging



More information about the pkg-multimedia-commits mailing list