Author: dmeyer
Date: Wed Mar 19 10:56:17 2008
New Revision: 3199

Log:
add shortcut for InProgressSignals

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    Wed Mar 19 10:56:17 2008
@@ -460,9 +460,15 @@
     """
     InProgress object that will be finished if one of the provided
     signals is emited. The return value is the number of the signal
-    starting with 0.
+    starting with 0. A second interface is to provide a dict of signals
+    as first parameter and the dict keys after that. E.g.
+    InProgressSignals(object.signals['completed'], object.signals['failed'])
+    InProgressSignals(object.signals, 'completed', 'failed')
     """
     def __init__(self, *signals):
+        assert(signals)
+        if isinstance(signals[0], dict):
+            signals = [ signals[0][key] for key in signals[1:] ]
         for num, signal in enumerate(signals):
             signal.connect_once(self.finish, num).set_user_args_first()
         self._signals = signals

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to