pitivi r1234 - in branches/SOC_2008_SLAKSHMAN: . pitivi



Author: edwardrv
Date: Sat Aug 16 08:08:00 2008
New Revision: 1234
URL: http://svn.gnome.org/viewvc/pitivi?rev=1234&view=rev

Log:
* pitivi/threads.py:
Added convenience CallbackThread class


Modified:
   branches/SOC_2008_SLAKSHMAN/ChangeLog
   branches/SOC_2008_SLAKSHMAN/pitivi/threads.py

Modified: branches/SOC_2008_SLAKSHMAN/pitivi/threads.py
==============================================================================
--- branches/SOC_2008_SLAKSHMAN/pitivi/threads.py	(original)
+++ branches/SOC_2008_SLAKSHMAN/pitivi/threads.py	Sat Aug 16 08:08:00 2008
@@ -66,6 +66,19 @@
 
 gobject.type_register(Thread)
 
+class CallbackThread(Thread):
+
+    def __init__(self, callback, *args, **kwargs):
+        self.callback = callback
+        self.args = args
+        self.kwargs = kwargs
+        Thread.__init__(self)
+
+    def process(self):
+        self.callback(*self.args, **self.kwargs)
+
+gobject.type_register(CallbackThread)
+
 class ThreadMaster(gobject.GObject):
     """
     Controls all thread existing in pitivi



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]