[SCM] morituri/master: * examples/gtkcrc.py: * morituri/common/task.py: Add task object to listener interface methods.

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


The following commit has been merged in the master branch:
commit eda9968703ad2df72502cdb2c02469734979e0ac
Author: Thomas Vander Stichele <thomas (at) apestaart (dot) org>
Date:   Sat Apr 11 16:42:04 2009 +0000

    	* examples/gtkcrc.py:
    	* morituri/common/task.py:
    	  Add task object to listener interface methods.

diff --git a/ChangeLog b/ChangeLog
index 330bc0e..a436a12 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2009-04-11  Thomas Vander Stichele  <thomas at apestaart dot org>
 
+	* examples/gtkcrc.py:
+	* morituri/common/task.py:
+	  Add task object to listener interface methods.
+
+2009-04-11  Thomas Vander Stichele  <thomas at apestaart dot org>
+
 	* morituri/common/task.py:
 	  Move methods around.
 
diff --git a/examples/gtkcrc.py b/examples/gtkcrc.py
index 4ac2a61..4e1737b 100644
--- a/examples/gtkcrc.py
+++ b/examples/gtkcrc.py
@@ -57,14 +57,14 @@ class TaskProgress(gtk.VBox, task.TaskRunner):
             gtk.main_iteration()
         task.start()
 
-    def started(self):
+    def started(self, task):
         pass
 
-    def stopped(self):
+    def stopped(self, task):
         self.emit('stop')
         # self._task.removeListener(self)
 
-    def progressed(self, value):
+    def progressed(self, task, value):
         gst.info('progressed')
         # FIXME: why is this not painting the progress bar ?
         self._progress.set_fraction(value)
diff --git a/morituri/common/task.py b/morituri/common/task.py
index ff16967..c7c8582 100644
--- a/morituri/common/task.py
+++ b/morituri/common/task.py
@@ -77,7 +77,7 @@ class Task(object):
     def _notifyListeners(self, methodName, *args, **kwargs):
             if self._listeners:
                 for l in self._listeners:
-                    getattr(l, methodName)(*args, **kwargs)
+                    getattr(l, methodName)(self, *args, **kwargs)
 
 class TaskRunner:
     """
@@ -94,7 +94,7 @@ class TaskRunner:
         raise NotImplementedError
 
     # listener callbacks
-    def progressed(self, value):
+    def progressed(self, task, value):
         """
         Implement me to be informed about progress.
 
@@ -102,12 +102,12 @@ class TaskRunner:
         @param value: progress, from 0.0 to 1.0
         """
 
-    def started(self):
+    def started(self, task):
         """
         Implement me to be informed about the task starting.
         """
 
-    def stopped(self):
+    def stopped(self, task):
         """
         Implement me to be informed about the task starting.
         """
@@ -120,7 +120,7 @@ class SyncRunner(TaskRunner):
         self._task.start()
         self._loop.run()
 
-    def progressed(self, value):
+    def progressed(self, task, value):
         sys.stdout.write('%s %3d %%\r' % (
             self._task.description, value * 100.0))
         sys.stdout.flush()
@@ -129,5 +129,5 @@ class SyncRunner(TaskRunner):
             sys.stdout.write('%s %3d %%\n' % (
                 self._task.description, 100.0))
 
-    def stopped(self):
+    def stopped(self, task):
         self._loop.quit()

-- 
morituri packaging



More information about the pkg-multimedia-commits mailing list