Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/tutorius/dbustools.py
diff options
context:
space:
mode:
Diffstat (limited to 'tutorius/dbustools.py')
-rw-r--r--tutorius/dbustools.py21
1 files changed, 19 insertions, 2 deletions
diff --git a/tutorius/dbustools.py b/tutorius/dbustools.py
index 02acd3d..d96594e 100644
--- a/tutorius/dbustools.py
+++ b/tutorius/dbustools.py
@@ -1,3 +1,18 @@
+# Copyright (C) 2009, Tutorius.org
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
import logging
import gobject
@@ -43,13 +58,15 @@ def remote_call(callable, args, return_cb=None, error_cb=None, block=False):
callable(*args, reply_handler=reply_cb, error_handler=errhandler_cb)
class Future(object):
- def __init__(self):
+ def __init__(self, log_name="default_Future"):
self._value = None
+ self._log_name = log_name
def get(self):
context = gobject.MainLoop().get_context()
while self._value == None and context.iteration(True):
- pass
+ LOGGER.debug("Future variable %s executed event loop while waiting for its value"%str(self._log_name))
+ LOGGER.debug("Future variable %s has received its value"%self._log_name)
return self._value
def _set(self, value):