diff options
author | mike <michael.jmontcalm@gmail.com> | 2009-11-16 16:48:54 (GMT) |
---|---|---|
committer | mike <michael.jmontcalm@gmail.com> | 2009-11-16 16:48:54 (GMT) |
commit | 80602ad46f0ec03e762f9dddfa5de67f37665f5d (patch) | |
tree | 1b2055927b46b92148e24559f42a87fb81eec090 | |
parent | 0c0ed009fd711e001d600d47bfa1db7d7fb3d23b (diff) | |
parent | 69e3f4598a8b1a4e3d20edcae524b05a8cc7f330 (diff) |
Merge branch 'master' of git://git.sugarlabs.org/tutorius/mainline
-rw-r--r-- | tutorius/dbustools.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tutorius/dbustools.py b/tutorius/dbustools.py index 5d70d7b..02acd3d 100644 --- a/tutorius/dbustools.py +++ b/tutorius/dbustools.py @@ -1,4 +1,6 @@ import logging +import gobject + LOGGER = logging.getLogger("sugar.tutorius.dbustools") def save_args(callable, *xargs, **xkwargs): @@ -40,3 +42,16 @@ def remote_call(callable, args, return_cb=None, error_cb=None, block=False): else: callable(*args, reply_handler=reply_cb, error_handler=errhandler_cb) +class Future(object): + def __init__(self): + self._value = None + + def get(self): + context = gobject.MainLoop().get_context() + while self._value == None and context.iteration(True): + pass + return self._value + + def _set(self, value): + self._value = value + |