Author: dmeyer
Date: Thu Feb 14 07:10:05 2008
New Revision: 3097

Log:
Remove YieldFunction from the public API and add a set_interval
function to manipulate the coroutine execution from the outside.


Modified:
   trunk/base/API_CHANGES.txt
   trunk/base/src/notifier/__init__.py
   trunk/base/src/notifier/coroutine.py

Modified: trunk/base/API_CHANGES.txt
==============================================================================
--- trunk/base/API_CHANGES.txt  (original)
+++ trunk/base/API_CHANGES.txt  Thu Feb 14 07:10:05 2008
@@ -70,3 +70,5 @@
    and WeakIOMonitor.
 
 4. Rename YieldContinue to NotFinished
+   Remove YieldFunction from the API, the class is now only for
+   internal use and may change without further notice.

Modified: trunk/base/src/notifier/__init__.py
==============================================================================
--- trunk/base/src/notifier/__init__.py (original)
+++ trunk/base/src/notifier/__init__.py Thu Feb 14 07:10:05 2008
@@ -56,7 +56,7 @@
 from event import Event, EventHandler, WeakEventHandler
 
 # coroutine decorator and helper classes
-from coroutine import NotFinished, YieldCallback, YieldFunction, coroutine
+from coroutine import NotFinished, YieldCallback, coroutine
 
 # process management
 from popen import Process

Modified: trunk/base/src/notifier/coroutine.py
==============================================================================
--- trunk/base/src/notifier/coroutine.py        (original)
+++ trunk/base/src/notifier/coroutine.py        Thu Feb 14 07:10:05 2008
@@ -56,7 +56,7 @@
 #
 # -----------------------------------------------------------------------------
 
-__all__ = [ 'NotFinished', 'YieldCallback', 'coroutine', 'YieldFunction' ]
+__all__ = [ 'NotFinished', 'YieldCallback', 'coroutine' ]
 
 # python imports
 import sys
@@ -144,7 +144,9 @@
     invocations will be queued.
 
     A function decorated with this decorator will always return an
-    InProgress object. It may already be finished.
+    InProgress object. It may already be finished. If it is not finished,
+    it has stop() and set_interval() member functions. If stop() is called,
+    the InProgress object will emit the finished signal.
     """
     def decorator(func):
         def newfunc(*args, **kwargs):
@@ -284,6 +286,18 @@
         return False
 
 
+    def set_interval(self, interval):
+        """
+        Set a new interval for the internal timer.
+        """
+        if not self._timer:
+            pass
+        if self._timer.active():
+            # restart timer
+            self._timer.start(interval)
+        self._interval = interval
+
+
     def stop(self):
         """
         Stop the function, no callbacks called.

-------------------------------------------------------------------------
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