comparison frontends/src/bridge/DBus.py @ 759:93bd868b8fb6

backend, frontends: callbacks refactoring: - launchAction is now async, and return a dictionary for its result - no more action_id, actionResult* are deprecated - callback system is about to be unified
author Goffi <goffi@goffi.org>
date Tue, 24 Dec 2013 15:19:08 +0100
parents e3ad48a2aab2
children bfabeedbf32e
comparison
equal deleted inserted replaced
758:86224a13cc1d 759:93bd868b8fb6
188 return self.db_core_iface.getWaitingSub(profile_key) 188 return self.db_core_iface.getWaitingSub(profile_key)
189 189
190 def isConnected(self, profile_key="@DEFAULT@"): 190 def isConnected(self, profile_key="@DEFAULT@"):
191 return self.db_core_iface.isConnected(profile_key) 191 return self.db_core_iface.isConnected(profile_key)
192 192
193 def launchAction(self, action_type, data, profile_key="@DEFAULT@"): 193 def launchAction(self, callback_id, data, profile_key="@DEFAULT@", callback=None, errback=None):
194 return unicode(self.db_core_iface.launchAction(action_type, data, profile_key)) 194 return self.db_core_iface.launchAction(callback_id, data, profile_key, reply_handler=callback, error_handler=lambda err:errback(err._dbus_error_name[len(const_ERROR_PREFIX)+1:]))
195 195
196 def registerNewAccount(self, login, password, email, host, port=5222): 196 def registerNewAccount(self, login, password, email, host, port=5222):
197 return unicode(self.db_core_iface.registerNewAccount(login, password, email, host, port)) 197 return unicode(self.db_core_iface.registerNewAccount(login, password, email, host, port))
198 198
199 def sendMessage(self, to_jid, message, subject='', mess_type="auto", extra={}, profile_key="@NONE@", callback=None, errback=None): 199 def sendMessage(self, to_jid, message, subject='', mess_type="auto", extra={}, profile_key="@NONE@", callback=None, errback=None):