Author: dmeyer
Date: Fri Jul 13 10:24:10 2007
New Revision: 2760

Log:
basic status support

Modified:
   trunk/base/src/notifier/async.py

Modified: trunk/base/src/notifier/async.py
==============================================================================
--- trunk/base/src/notifier/async.py    (original)
+++ trunk/base/src/notifier/async.py    Fri Jul 13 10:24:10 2007
@@ -53,6 +53,27 @@
         Signal.__init__(self)
         self.exception_handler = Signal()
         self.is_finished = False
+        self.status = None
+
+
+    def set_status(self, s):
+        """
+        Connect a status object to the InProgress object. The status object
+        has to be updated by the creator of that object. The status should
+        be a Signal so the monitoring function can connect to it to get
+        notified on updates.
+        """
+        self.status = s
+
+
+    def get_status(self):
+        """
+        Return status object if connected or return True if the function is
+        still in progress or False if not.
+        """
+        if self.status is not None:
+            return self.status
+        return not is_finished
 
 
     def finished(self, result):
@@ -121,7 +142,7 @@
         """
         return self()
 
-    
+
     def _connect(self, callback, args = (), kwargs = {}, once = False,
                  weak = False, pos = -1):
         """

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to