From: Dirk M. <di...@fr...> - 2008-02-11 10:06:36
|
Author: dmeyer Date: Mon Feb 11 05:06:39 2008 New Revision: 3045 Log: adjust to latest kaa.MainThreadCallback changes Modified: trunk/base/src/notifier/main.py trunk/base/src/notifier/reactor.py trunk/beacon/src/client.py trunk/cherrypy/src/controller.py Modified: trunk/base/src/notifier/main.py ============================================================================== --- trunk/base/src/notifier/main.py (original) +++ trunk/base/src/notifier/main.py Mon Feb 11 05:06:39 2008 @@ -42,7 +42,7 @@ import nf_wrapper as notifier from callback import Signal from popen import proclist as _proclist -from thread import MainThreadCallback, is_mainthread, wakeup, set_as_mainthread +from thread import is_mainthread, wakeup, set_as_mainthread from jobserver import killall as kill_jobserver from decorators import execute_in_mainloop Modified: trunk/base/src/notifier/reactor.py ============================================================================== --- trunk/base/src/notifier/reactor.py (original) +++ trunk/base/src/notifier/reactor.py Mon Feb 11 05:06:39 2008 @@ -43,9 +43,7 @@ Callback from the Twisted thread kaa should execute from the mainloop. """ - a = kaa.MainThreadCallback(func) - a.set_async(False) - return a() + return kaa.MainThreadCallback(func)().wait() def _kaa_stop(self): Modified: trunk/beacon/src/client.py ============================================================================== --- trunk/beacon/src/client.py (original) +++ trunk/beacon/src/client.py Mon Feb 11 05:06:39 2008 @@ -117,9 +117,7 @@ if not kaa.is_mainthread(): # sqlite db was opened in the mainthread, so we must perform # all our queries there as well. - cb = kaa.MainThreadCallback(self.query) - cb.set_async(False) - return cb(**query) + return kaa.MainThreadCallback(self.query)(**query).wait() result = Query(self, **query) self._queries.append(weakref(result)) Modified: trunk/cherrypy/src/controller.py ============================================================================== --- trunk/cherrypy/src/controller.py (original) +++ trunk/cherrypy/src/controller.py Mon Feb 11 05:06:39 2008 @@ -90,9 +90,9 @@ def newfunc(self, *args, **kwargs): _function = func if mainloop and not kaa.is_mainthread(): - _function = kaa.MainThreadCallback(func) - _function.set_async(False) - result = _function(self, *args, **kwargs) + result = kaa.MainThreadCallback(func)(self, *args, **kwargs).wait() + else: + result = func(self, *args, **kwargs) if not template: return result return engine.parse(template, result) |