comparison src/bridge/bridge_constructor/dbus_core_template.py @ 425:e4e9187e3b5b

backend, bridge: asynchronous history quick_frontend: use of asynchronous history
author Goffi <goffi@goffi.org>
date Tue, 08 Nov 2011 01:08:11 +0100
parents 72c13313b6d6
children cf005701624b
comparison
equal deleted inserted replaced
424:72c13313b6d6 425:e4e9187e3b5b
78 else: 78 else:
79 async = False 79 async = False
80 result = self.cb[name](*args, **kwargs) 80 result = self.cb[name](*args, **kwargs)
81 if async: 81 if async:
82 if not isinstance(result, Deferred): 82 if not isinstance(result, Deferred):
83 error("Asynchrone method [%s] does not return a Deferred." % name) 83 error("Asynchronous method [%s] does not return a Deferred." % name)
84 raise AsyncNotDeferred 84 raise AsyncNotDeferred
85 result.addCallback(callback) 85 result.addCallback(callback)
86 result.addErrback(lambda err:errback(GenericException(err))) 86 result.addErrback(lambda err:errback(GenericException(err)))
87 else: 87 else:
88 if isinstance(result, Deferred): 88 if isinstance(result, Deferred):
89 error("Synchrone method [%s] return a Deferred." % name) 89 error("Synchronous method [%s] return a Deferred." % name)
90 raise DeferredNotAsync 90 raise DeferredNotAsync
91 return result 91 return result
92 92
93 ### signals ### 93 ### signals ###
94 94