quick frontends (app): retrieve namespaces on startup
This commit is contained in:
parent
fd73022ccb
commit
212b4fe88a
1 changed files with 12 additions and 1 deletions
|
|
@ -195,6 +195,9 @@ class ProfilesManager(object):
|
|||
def iteritems(self):
|
||||
return self._profiles.iteritems()
|
||||
|
||||
def itervalues(self):
|
||||
return self._profiles.itervalues()
|
||||
|
||||
def plug(self, profile):
|
||||
if profile in self._profiles:
|
||||
raise exceptions.ConflictError('A profile of the name [{}] is already plugged'.format(profile))
|
||||
|
|
@ -259,12 +262,20 @@ class QuickApp(object):
|
|||
self._notif_id = 0
|
||||
self._notifications = OrderedDict()
|
||||
self.features = None
|
||||
self.ns_map = {} # map of short name to namespaces
|
||||
|
||||
def connectBridge(self):
|
||||
self.bridge.bridgeConnect(callback=self._bridgeCb, errback=self._bridgeEb)
|
||||
|
||||
def _namespacesGetCb(self, ns_map):
|
||||
self.ns_map = ns_map
|
||||
|
||||
def _namespacesGetEb(self, failure_):
|
||||
log.error(_(u"Can't get namespaces map: {msg}").format(msg=failure_))
|
||||
|
||||
def onBridgeConnected(self):
|
||||
pass
|
||||
self.bridge.namespacesGet(callback=self._namespacesGetCb,
|
||||
errback=self._namespacesGetEb)
|
||||
|
||||
def _bridgeCb(self):
|
||||
self.registerSignal("connected")
|
||||
|
|
|
|||
Loading…
Reference in a new issue