Author: dmeyer
Date: Sat Mar 18 19:01:14 2006
New Revision: 1306

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

Log:
prevent recursion

Modified: trunk/base/src/notifier/decorators.py
==============================================================================
--- trunk/base/src/notifier/decorators.py       (original)
+++ trunk/base/src/notifier/decorators.py       Sat Mar 18 19:01:14 2006
@@ -31,11 +31,17 @@
 
 __all__ = [ 'execute_in_timer', 'execute_in_thread', 'execute_in_mainloop' ]
 
+# python imports
+import logging
+
 # notifier thread imports
 from thread import MainThreadCallback, is_mainthread
 from jobserver import ThreadCallback
 from kaa.weakref import weakref
 
+# get logging object
+log = logging.getLogger('notifier')
+
 def execute_in_timer(timer, interval, type=''):
     """
     Decorator to call the decorated function in a Timer. When calling the
@@ -60,7 +66,9 @@
         def newfunc(*args, **kwargs):
             if not type:
                 # just start the timer
-                timer(func, *args, **kwargs).start(interval)
+                t = timer(func, *args, **kwargs)
+                t.set_prevent_recursion()
+                t.start(interval)
                 return True
             # object to save the timer in
             obj  = func
@@ -84,6 +92,7 @@
 
             # create new timer, set it to the object and start it
             t = timer(func, *args, **kwargs)
+            t.set_prevent_recursion()
             setattr(obj, name, weakref(t))
             getattr(obj, name).start(interval)
             return True


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to