Author: dmeyer
Date: Mon Jan 22 17:27:20 2007
New Revision: 2436

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

Log:
support Signals/functions in YieldCallback.__init__

Modified: trunk/base/src/notifier/yieldfunc.py
==============================================================================
--- trunk/base/src/notifier/yieldfunc.py        (original)
+++ trunk/base/src/notifier/yieldfunc.py        Mon Jan 22 17:27:20 2007
@@ -62,6 +62,7 @@
 import sys
 import logging
 
+from callback import Signal
 from timer import Timer
 from async import InProgress
 
@@ -75,11 +76,19 @@
     async. Return this object using 'yield' and use the memeber function
     'get' later to get the result.
     """
+    def __init__(self, func=None):
+        if func is not None:
+            if isinstance(func, Signal):
+                func = func.connect_once
+            func(self)
+
+
     def __call__(self, *args, **kwargs):
         self._args = args
         self._kwargs = kwargs
         self._callback()
         self._callback = None
+        return False
 
 
     def _connect(self, callback):

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to