Author: dmeyer
Date: Sat Mar 18 19:01:47 2006
New Revision: 1307

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

Log:
do not call timer when already inactive

Modified: trunk/base/src/notifier/timer.py
==============================================================================
--- trunk/base/src/notifier/timer.py    (original)
+++ trunk/base/src/notifier/timer.py    Sat Mar 18 19:01:47 2006
@@ -31,9 +31,14 @@
 
 __all__ = [ 'Timer', 'WeakTimer', 'OneShotTimer', 'WeakOneShotTimer' ]
 
+import logging
+
 from callback import NotifierCallback, WeakNotifierCallback, notifier
 from thread import MainThreadCallback, is_mainthread
 
+# get logging object
+log = logging.getLogger('notifier')
+
 class Timer(NotifierCallback):
 
     def __init__(self, callback, *args, **kwargs):
@@ -71,6 +76,17 @@
         return self._interval
 
 
+    def __call__(self, *args, **kwargs):
+        if not self.active():
+            # This should not happen, but it does. Somewhere deep inside the
+            # notifier code is a bug
+            log.error('calling inactivate callback for %s', self)
+            import traceback
+            traceback.print_stack()
+            return False
+
+        return super(Timer, self).__call__(*args, **kwargs)
+
 
 class OneShotTimer(Timer):
     """
@@ -81,7 +97,7 @@
     """
     def __call__(self, *args, **kwargs):
         self.unregister()
-        super(OneShotTimer, self).__call__(*args, **kwargs)
+        super(Timer, self).__call__(*args, **kwargs)
         return False
 
 


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