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
This commit is contained in:
Goffi 2013-12-24 15:19:08 +01:00
commit 069a250b04

View file

@ -190,8 +190,8 @@ class DBusBridgeFrontend(BridgeFrontend):
def isConnected(self, profile_key="@DEFAULT@"):
return self.db_core_iface.isConnected(profile_key)
def launchAction(self, action_type, data, profile_key="@DEFAULT@"):
return unicode(self.db_core_iface.launchAction(action_type, data, profile_key))
def launchAction(self, callback_id, data, profile_key="@DEFAULT@", callback=None, errback=None):
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:]))
def registerNewAccount(self, login, password, email, host, port=5222):
return unicode(self.db_core_iface.registerNewAccount(login, password, email, host, port))