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
2 changed files with 244 additions and 232 deletions

View file

@ -593,28 +593,34 @@ doc_param_4=%(doc_profile_key)s
async=
type=method
category=code
sig_in=sis
sig_in=sisss
sig_out=a{ss}
param_1_default=-1
param_2_default="@DEFAULT@"
param_2_default=""
param_3_default=""
param_4_default="@DEFAULT@"
doc=Get "attribute" for all params of a category
doc_param_0=category: as for [setParam]
doc_param_1=%(doc_security_limit)s
doc_param_2=%(doc_profile_key)s
doc_param_2=app: name of the frontend requesting the parameters, or '' to get all parameters
doc_param_3=extra: extra options/filters
doc_param_4=%(doc_profile_key)s
[getParamsUI]
async=
type=method
category=core
sig_in=iss
sig_in=isss
sig_out=s
param_0_default=-1
param_1_default=''
param_2_default="@DEFAULT@"
param_2_default=''
param_3_default="@DEFAULT@"
doc=Return a SàT XMLUI for parameters, eventually restrict the result to the parameters concerning a given frontend
doc_param_0=%(doc_security_limit)s
doc_param_1=app: name of the frontend requesting the parameters, or '' to get all parameters
doc_param_2=%(doc_profile_key)s
doc_param_2=extra: extra options/filters
doc_param_3=%(doc_profile_key)s
[getParamsCategories]
type=method

View file

@ -235,10 +235,10 @@ class DbusObject(dbus.service.Object):
return self._callback("asyncGetParamA", str(name), str(category), str(attribute), security_limit, str(profile_key), callback=callback, errback=errback)
@dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
in_signature='sis', out_signature='a{ss}',
in_signature='sisss', out_signature='a{ss}',
async_callbacks=('callback', 'errback'))
def asyncGetParamsValuesFromCategory(self, category, security_limit=-1, profile_key="@DEFAULT@", callback=None, errback=None):
return self._callback("asyncGetParamsValuesFromCategory", str(category), security_limit, str(profile_key), callback=callback, errback=errback)
def asyncGetParamsValuesFromCategory(self, category, security_limit=-1, app="", extra="", profile_key="@DEFAULT@", callback=None, errback=None):
return self._callback("asyncGetParamsValuesFromCategory", str(category), security_limit, str(app), str(extra), str(profile_key), callback=callback, errback=errback)
@dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
in_signature='ssa{ss}', out_signature='b',
@ -349,10 +349,10 @@ class DbusObject(dbus.service.Object):
return self._callback("getParamsCategories", )
@dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
in_signature='iss', out_signature='s',
in_signature='isss', out_signature='s',
async_callbacks=('callback', 'errback'))
def getParamsUI(self, security_limit=-1, app='', profile_key="@DEFAULT@", callback=None, errback=None):
return self._callback("getParamsUI", security_limit, str(app), str(profile_key), callback=callback, errback=errback)
def getParamsUI(self, security_limit=-1, app='', extra='', profile_key="@DEFAULT@", callback=None, errback=None):
return self._callback("getParamsUI", security_limit, str(app), str(extra), str(profile_key), callback=callback, errback=errback)
@dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
in_signature='s', out_signature='a{sa{s(sia{ss})}}',