From: Ed Page Date: Fri, 12 Feb 2010 03:31:04 +0000 (-0600) Subject: Making Async and Timeout callable X-Git-Url: http://git.maemo.org/git/?p=theonering;a=commitdiff_plain;h=5bfb4228f1fff939aa06dfbe446cf17b5ce3ed76 Making Async and Timeout callable --- diff --git a/src/util/go_utils.py b/src/util/go_utils.py index 8b72dff..47fb16b 100644 --- a/src/util/go_utils.py +++ b/src/util/go_utils.py @@ -74,6 +74,9 @@ class Async(object): gobject.source_remove(self.__idleId) self.__idleId = None + def __call__(self): + return self.start() + @misc.log_exception(_moduleLogger) def _on_once(self): self.cancel() @@ -105,6 +108,9 @@ class Timeout(object): gobject.source_remove(self.__timeoutId) self.__timeoutId = None + def __call__(self, **kwds): + return self.start(**kwds) + @misc.log_exception(_moduleLogger) def _on_once(self): self.cancel()