Fixing a bug referencing a non-existent variable
[theonering] / src / util / go_utils.py
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)