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.
This commit is contained in:
Goffi 2020-01-25 21:08:40 +01:00
commit 87659cf0f0

View file

@ -175,8 +175,8 @@ class Bridge(object):
errback = self._generic_errback
d.addErrback(errback)
def asyncGetParamsValuesFromCategory(self, category, security_limit=-1, profile_key="@DEFAULT@", callback=None, errback=None):
d = self.root.callRemote("asyncGetParamsValuesFromCategory", category, security_limit, profile_key)
def asyncGetParamsValuesFromCategory(self, category, security_limit=-1, app="", extra="", profile_key="@DEFAULT@", callback=None, errback=None):
d = self.root.callRemote("asyncGetParamsValuesFromCategory", category, security_limit, app, extra, profile_key)
if callback is not None:
d.addCallback(callback)
if errback is None:
@ -327,8 +327,8 @@ class Bridge(object):
errback = self._generic_errback
d.addErrback(errback)
def getParamsUI(self, security_limit=-1, app='', profile_key="@DEFAULT@", callback=None, errback=None):
d = self.root.callRemote("getParamsUI", security_limit, app, profile_key)
def getParamsUI(self, security_limit=-1, app='', extra='', profile_key="@DEFAULT@", callback=None, errback=None):
d = self.root.callRemote("getParamsUI", security_limit, app, extra, profile_key)
if callback is not None:
d.addCallback(callback)
if errback is None:
@ -664,8 +664,8 @@ class AIOBridge(Bridge):
d.addErrback(self._errback)
return d.asFuture(asyncio.get_event_loop())
def asyncGetParamsValuesFromCategory(self, category, security_limit=-1, profile_key="@DEFAULT@"):
d = self.root.callRemote("asyncGetParamsValuesFromCategory", category, security_limit, profile_key)
def asyncGetParamsValuesFromCategory(self, category, security_limit=-1, app="", extra="", profile_key="@DEFAULT@"):
d = self.root.callRemote("asyncGetParamsValuesFromCategory", category, security_limit, app, extra, profile_key)
d.addErrback(self._errback)
return d.asFuture(asyncio.get_event_loop())
@ -759,8 +759,8 @@ class AIOBridge(Bridge):
d.addErrback(self._errback)
return d.asFuture(asyncio.get_event_loop())
def getParamsUI(self, security_limit=-1, app='', profile_key="@DEFAULT@"):
d = self.root.callRemote("getParamsUI", security_limit, app, profile_key)
def getParamsUI(self, security_limit=-1, app='', extra='', profile_key="@DEFAULT@"):
d = self.root.callRemote("getParamsUI", security_limit, app, extra, profile_key)
d.addErrback(self._errback)
return d.asFuture(asyncio.get_event_loop())