Fixing a bug referencing a non-existent variable
authorEd Page <eopage@byu.net>
Fri, 12 Feb 2010 12:44:21 +0000 (06:44 -0600)
committerEd Page <eopage@byu.net>
Fri, 12 Feb 2010 12:44:21 +0000 (06:44 -0600)
src/gvoice/state_machine.py
src/util/go_utils.py

index 4dcd809..514fb92 100644 (file)
@@ -294,7 +294,7 @@ class UpdateStateMachine(StateMachine):
                self._reset_timers()
 
        def _reset_timers(self, initialize=False):
-               if self._timeoutId is None:
+               if self._onTimeout.is_running():
                        return # not started yet
                _moduleLogger.info("%s Resetting State Machine" % (self._name, ))
                self._onTimeout.cancel()
index 47fb16b..e8fde8b 100644 (file)
@@ -69,6 +69,9 @@ class Async(object):
                else:
                        self.__idleId = gobject.idle_add(self.__func)
 
+       def is_running(self):
+               return self.__idleId is not None
+
        def cancel(self):
                if self.__idleId is not None:
                        gobject.source_remove(self.__idleId)
@@ -103,6 +106,9 @@ class Timeout(object):
                else:
                        timeout_add_seconds(timeoutInSeconds, self._on_once)
 
+       def is_running(self):
+               return self.__timeoutId is not None
+
        def cancel(self):
                if self.__timeoutId is not None:
                        gobject.source_remove(self.__timeoutId)