diff options
author | JCTutorius <charlie@tutorius-dev.(none)> | 2009-11-06 01:13:26 (GMT) |
---|---|---|
committer | JCTutorius <charlie@tutorius-dev.(none)> | 2009-11-06 01:13:26 (GMT) |
commit | 29aea8f7d71d5584e011a6955999e37efe6343f9 (patch) | |
tree | b2d59c925adf470d89f40458b5656219913bae31 /tutorius/dbustools.py | |
parent | 7035c6e281332b1688c59877ac78516a0dd4635d (diff) | |
parent | 69e3f4598a8b1a4e3d20edcae524b05a8cc7f330 (diff) |
Merge branch 'master' of gitorious@git.sugarlabs.org:tutorius/mainlinelp458452
Diffstat (limited to 'tutorius/dbustools.py')
-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 + |