Mercurial > libervia-backend
diff frontends/src/bridge/DBus.py @ 1592:d6d655238a93
bridge: new core method profileStartSession to start a session without connecting the profile
author | Goffi <goffi@goffi.org> |
---|---|
date | Sat, 14 Nov 2015 19:18:10 +0100 |
parents | 698d6755d62a |
children | a3d0cfa5b7a6 |
line wrap: on
line diff
--- a/frontends/src/bridge/DBus.py Sat Nov 14 19:18:10 2015 +0100 +++ b/frontends/src/bridge/DBus.py Sat Nov 14 19:18:10 2015 +0100 @@ -543,6 +543,29 @@ kwargs['error_handler'] = error_handler return self.db_core_iface.paramsRegisterApp(xml, security_limit, app, **kwargs) + def profileIsSessionStarted(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.profileIsSessionStarted(profile_key, **kwargs) + + def profileStartSession(self, password='', 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)) + return self.db_core_iface.profileStartSession(password, profile_key, timeout=const_TIMEOUT, reply_handler=callback, error_handler=error_handler) + def progressGet(self, id, profile, callback=None, errback=None): if callback is None: error_handler = None