bridge, quick_frontend: preparation for async bridge
bridge can currently have sync and async methods. This commit prepare the transition to fully async bridges:
- a new bridgeConnect method must be called to prepare the bridge
- quick app, quick profile manager: changed sync calls to async ones
- quick app: bridgeConnect can be called automatically or manually depending on connect_bridge parameter of QuickApp
This commit is contained in:
parent
58795c675c
commit
34cec8fe14
1 changed files with 82 additions and 37 deletions
|
|
@ -60,7 +60,8 @@ def dbus_to_bridge_exception(dbus_e):
|
|||
|
||||
|
||||
class Bridge(BridgeFrontend):
|
||||
def __init__(self):
|
||||
|
||||
def bridgeConnect(self, callback, errback):
|
||||
try:
|
||||
self.sessions_bus = dbus.SessionBus()
|
||||
self.db_object = self.sessions_bus.get_object(const_INT_PREFIX,
|
||||
|
|
@ -72,12 +73,13 @@ class Bridge(BridgeFrontend):
|
|||
except dbus.exceptions.DBusException, e:
|
||||
if e._dbus_error_name in ('org.freedesktop.DBus.Error.ServiceUnknown',
|
||||
'org.freedesktop.DBus.Error.Spawn.ExecFailed'):
|
||||
raise BridgeExceptionNoService
|
||||
errback(BridgeExceptionNoService())
|
||||
elif e._dbus_error_name == 'org.freedesktop.DBus.Error.NotSupported':
|
||||
log.error(_(u"D-Bus is not launched, please see README to see instructions on how to launch it"))
|
||||
raise BridgeInitError
|
||||
errback(BridgeInitError)
|
||||
else:
|
||||
raise e
|
||||
errback(e)
|
||||
callback()
|
||||
#props = self.db_core_iface.getProperties()
|
||||
|
||||
def register_signal(self, functionName, handler, iface="core"):
|
||||
|
|
|
|||
Loading…
Reference in a new issue