For historical reasons, a broken attempt at capabilities
[theonering] / src / gvoice / state_machine.py
index c33a9c8..511ccde 100644 (file)
@@ -1,8 +1,7 @@
 #!/usr/bin/env python
 
 """
-@todo Look into switching from POLL_TIME = min(F * 2^n, MAX) to POLL_TIME = min(CONST + F * 2^n, MAX)
-@todo Look into supporting more states that have a different F and MAX
+@todo Look into supporting more states
 """
 
 import logging
@@ -177,6 +176,7 @@ class UpdateStateMachine(StateMachine):
                _moduleLogger.info("%s Starting State Machine" % (self._name, ))
 
        def stop(self):
+               _moduleLogger.info("%s Stopping State Machine" % (self._name, ))
                self._stop_update()
 
        def close(self):
@@ -197,6 +197,7 @@ class UpdateStateMachine(StateMachine):
                return self._state
 
        def reset_timers(self):
+               _moduleLogger.info("%s Resetting State Machine" % (self._name, ))
                self._reset_timers()
 
        @property
@@ -237,12 +238,11 @@ class UpdateStateMachine(StateMachine):
 
        @gtk_toolbox.log_exception(_moduleLogger)
        def _on_timeout(self):
-               _moduleLogger.debug("%s Update" % (self._name))
+               self._timeoutId = None
+               self._schedule_update()
                for item in self._updateItems:
                        try:
                                item.update(force=True)
                        except Exception:
                                _moduleLogger.exception("Update failed for %r" % item)
-               self._timeoutId = None
-               self._schedule_update()
                return False # do not continue