comparison frontends/src/quick_frontend/quick_app.py @ 1655:ad2ad28b8923

quick_frontend: getFeatures is called on profile plug, and saved in host.features
author Goffi <goffi@goffi.org>
date Mon, 23 Nov 2015 23:30:41 +0100
parents e00f450c25fc
children 683b76c1145d
comparison
equal deleted inserted replaced
1654:22a8e770cb7b 1655:ad2ad28b8923
77 self._plug_profile_afterconnect() 77 self._plug_profile_afterconnect()
78 78
79 def _plug_profile_afterconnect(self): 79 def _plug_profile_afterconnect(self):
80 # Profile can be connected or not 80 # Profile can be connected or not
81 # we get cached data 81 # we get cached data
82 self.host.bridge.getFeatures(profile_key=self.profile, callback=self._plug_profile_getFeaturesCb, errback=self._plug_profile_getFeaturesEb)
83
84 def _plug_profile_getFeaturesEb(self, failure):
85 log.error(u"Couldn't get features: {}".format(failure))
86 self._plug_profile_getFeaturesCb({})
87
88 def _plug_profile_getFeaturesCb(self, features):
89 self.host.features = features
82 self.host.bridge.getEntitiesData([], ProfileManager.cache_keys_to_get, profile=self.profile, callback=self._plug_profile_gotCachedValues, errback=self._plug_profile_failedCachedValues) 90 self.host.bridge.getEntitiesData([], ProfileManager.cache_keys_to_get, profile=self.profile, callback=self._plug_profile_gotCachedValues, errback=self._plug_profile_failedCachedValues)
83 91
84 def _plug_profile_failedCachedValues(self, failure): 92 def _plug_profile_failedCachedValues(self, failure):
85 log.error(u"Couldn't get cached values: {}".format(failure)) 93 log.error(u"Couldn't get cached values: {}".format(failure))
86 self._plug_profile_gotCachedValues({}) 94 self._plug_profile_gotCachedValues({})
268 quick_games.Radiocol.registerSignals(self) 276 quick_games.Radiocol.registerSignals(self)
269 277
270 self.current_action_ids = set() # FIXME: to be removed 278 self.current_action_ids = set() # FIXME: to be removed
271 self.current_action_ids_cb = {} # FIXME: to be removed 279 self.current_action_ids_cb = {} # FIXME: to be removed
272 self.media_dir = self.bridge.getConfig('', 'media_dir') 280 self.media_dir = self.bridge.getConfig('', 'media_dir')
281 self.features = None
273 282
274 @property 283 @property
275 def current_profile(self): 284 def current_profile(self):
276 """Profile that a user would expect to use""" 285 """Profile that a user would expect to use"""
277 try: 286 try: