Mercurial > libervia-backend
diff frontends/src/bridge/DBus.py @ 1622:5b24d6bf5d15
core, bridge: actionsGet:
- added a new mechanism to keep actions until they are answered (or timeout-ed)
- keep_id must be explicitly used on actionNew
- actionsGet is used to retrive these actions
- the mechanism is used in deferXMLUI
author | Goffi <goffi@goffi.org> |
---|---|
date | Tue, 17 Nov 2015 21:28:58 +0100 |
parents | a3d0cfa5b7a6 |
children | 63cef4dbf2a4 |
line wrap: on
line diff
--- a/frontends/src/bridge/DBus.py Tue Nov 17 20:18:51 2015 +0100 +++ b/frontends/src/bridge/DBus.py Tue Nov 17 21:28:58 2015 +0100 @@ -123,6 +123,20 @@ return getPluginMethod + def actionsGet(self, profile_key="@DEFAULT@", callback=None, errback=None): + if callback is None: + error_handler = None + else: + if errback is None: + errback = log.error + error_handler = lambda err:errback(dbus_to_bridge_exception(err)) + kwargs={} + if callback is not None: + kwargs['timeout'] = const_TIMEOUT + kwargs['reply_handler'] = callback + kwargs['error_handler'] = error_handler + return self.db_core_iface.actionsGet(profile_key, **kwargs) + def addContact(self, entity_jid, profile_key="@DEFAULT@", callback=None, errback=None): if callback is None: error_handler = None