# HG changeset patch # User Goffi # Date 1526976453 -7200 # Node ID bd9d92bc0d6c1f38817f90a5c576a39cf31cf1f8 # Parent 282d1314d574c3148386ef4bf4b5c2de63712297 quick frontends (app): retrieve namespaces on startup diff -r 282d1314d574 -r bd9d92bc0d6c sat_frontends/quick_frontend/quick_app.py --- a/sat_frontends/quick_frontend/quick_app.py Tue May 22 10:06:07 2018 +0200 +++ b/sat_frontends/quick_frontend/quick_app.py Tue May 22 10:07:33 2018 +0200 @@ -195,6 +195,9 @@ 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 @@ 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")