comparison sat_frontends/bridge/pb.py @ 3123:130f9cb6e0ab

core (memory/params): added `extra` argument to filter out params notably in `getParamsUI`: In some case, it may be desirable for a frontend to not expose some parameters to user (e.g. it is the case on Android with the `autoconnect_backend` parameter). An new `extra` parameter has been added to a couple of parameters method for that: it can contain the `ignore` key with a list of [category, name] of parameters to skip.
author Goffi <goffi@goffi.org>
date Sat, 25 Jan 2020 21:08:40 +0100
parents 2cc2f65379f7
children 9d0df638c8b4
comparison
equal deleted inserted replaced
3122:4486d72658b9 3123:130f9cb6e0ab
173 d.addCallback(callback) 173 d.addCallback(callback)
174 if errback is None: 174 if errback is None:
175 errback = self._generic_errback 175 errback = self._generic_errback
176 d.addErrback(errback) 176 d.addErrback(errback)
177 177
178 def asyncGetParamsValuesFromCategory(self, category, security_limit=-1, profile_key="@DEFAULT@", callback=None, errback=None): 178 def asyncGetParamsValuesFromCategory(self, category, security_limit=-1, app="", extra="", profile_key="@DEFAULT@", callback=None, errback=None):
179 d = self.root.callRemote("asyncGetParamsValuesFromCategory", category, security_limit, profile_key) 179 d = self.root.callRemote("asyncGetParamsValuesFromCategory", category, security_limit, app, extra, profile_key)
180 if callback is not None: 180 if callback is not None:
181 d.addCallback(callback) 181 d.addCallback(callback)
182 if errback is None: 182 if errback is None:
183 errback = self._generic_errback 183 errback = self._generic_errback
184 d.addErrback(errback) 184 d.addErrback(errback)
325 d.addCallback(callback) 325 d.addCallback(callback)
326 if errback is None: 326 if errback is None:
327 errback = self._generic_errback 327 errback = self._generic_errback
328 d.addErrback(errback) 328 d.addErrback(errback)
329 329
330 def getParamsUI(self, security_limit=-1, app='', profile_key="@DEFAULT@", callback=None, errback=None): 330 def getParamsUI(self, security_limit=-1, app='', extra='', profile_key="@DEFAULT@", callback=None, errback=None):
331 d = self.root.callRemote("getParamsUI", security_limit, app, profile_key) 331 d = self.root.callRemote("getParamsUI", security_limit, app, extra, profile_key)
332 if callback is not None: 332 if callback is not None:
333 d.addCallback(callback) 333 d.addCallback(callback)
334 if errback is None: 334 if errback is None:
335 errback = self._generic_errback 335 errback = self._generic_errback
336 d.addErrback(errback) 336 d.addErrback(errback)
662 def asyncGetParamA(self, name, category, attribute="value", security_limit=-1, profile_key="@DEFAULT@"): 662 def asyncGetParamA(self, name, category, attribute="value", security_limit=-1, profile_key="@DEFAULT@"):
663 d = self.root.callRemote("asyncGetParamA", name, category, attribute, security_limit, profile_key) 663 d = self.root.callRemote("asyncGetParamA", name, category, attribute, security_limit, profile_key)
664 d.addErrback(self._errback) 664 d.addErrback(self._errback)
665 return d.asFuture(asyncio.get_event_loop()) 665 return d.asFuture(asyncio.get_event_loop())
666 666
667 def asyncGetParamsValuesFromCategory(self, category, security_limit=-1, profile_key="@DEFAULT@"): 667 def asyncGetParamsValuesFromCategory(self, category, security_limit=-1, app="", extra="", profile_key="@DEFAULT@"):
668 d = self.root.callRemote("asyncGetParamsValuesFromCategory", category, security_limit, profile_key) 668 d = self.root.callRemote("asyncGetParamsValuesFromCategory", category, security_limit, app, extra, profile_key)
669 d.addErrback(self._errback) 669 d.addErrback(self._errback)
670 return d.asFuture(asyncio.get_event_loop()) 670 return d.asFuture(asyncio.get_event_loop())
671 671
672 def connect(self, profile_key="@DEFAULT@", password='', options={}): 672 def connect(self, profile_key="@DEFAULT@", password='', options={}):
673 d = self.root.callRemote("connect", profile_key, password, options) 673 d = self.root.callRemote("connect", profile_key, password, options)
757 def getParamsCategories(self): 757 def getParamsCategories(self):
758 d = self.root.callRemote("getParamsCategories") 758 d = self.root.callRemote("getParamsCategories")
759 d.addErrback(self._errback) 759 d.addErrback(self._errback)
760 return d.asFuture(asyncio.get_event_loop()) 760 return d.asFuture(asyncio.get_event_loop())
761 761
762 def getParamsUI(self, security_limit=-1, app='', profile_key="@DEFAULT@"): 762 def getParamsUI(self, security_limit=-1, app='', extra='', profile_key="@DEFAULT@"):
763 d = self.root.callRemote("getParamsUI", security_limit, app, profile_key) 763 d = self.root.callRemote("getParamsUI", security_limit, app, extra, profile_key)
764 d.addErrback(self._errback) 764 d.addErrback(self._errback)
765 return d.asFuture(asyncio.get_event_loop()) 765 return d.asFuture(asyncio.get_event_loop())
766 766
767 def getPresenceStatuses(self, profile_key="@DEFAULT@"): 767 def getPresenceStatuses(self, profile_key="@DEFAULT@"):
768 d = self.root.callRemote("getPresenceStatuses", profile_key) 768 d = self.root.callRemote("getPresenceStatuses", profile_key)