comparison sat/memory/memory.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 8b36e5c3f28f
children 73b5228715e8
comparison
equal deleted inserted replaced
3122:4486d72658b9 3123:130f9cb6e0ab
1128 ): 1128 ):
1129 return self.params.asyncGetParamA( 1129 return self.params.asyncGetParamA(
1130 name, category, attr, security_limit, profile_key 1130 name, category, attr, security_limit, profile_key
1131 ) 1131 )
1132 1132
1133 def asyncGetParamsValuesFromCategory( 1133 def _getParamsValuesFromCategory(
1134 self, category, security_limit=C.NO_SECURITY_LIMIT, profile_key=C.PROF_KEY_NONE 1134 self, category, security_limit, app, extra_s, profile_key
1135 ): 1135 ):
1136 return self.params.asyncGetParamsValuesFromCategory( 1136 return self.params._getParamsValuesFromCategory(
1137 category, security_limit, profile_key 1137 category, security_limit, app, extra_s, profile_key
1138 ) 1138 )
1139 1139
1140 def asyncGetStringParamA( 1140 def asyncGetStringParamA(
1141 self, 1141 self, name, category, attr="value", security_limit=C.NO_SECURITY_LIMIT,
1142 name, 1142 profile_key=C.PROF_KEY_NONE):
1143 category, 1143
1144 attr="value", 1144 profile = self.getProfileName(profile_key)
1145 security_limit=C.NO_SECURITY_LIMIT, 1145 return defer.ensureDeferred(self.params.asyncGetStringParamA(
1146 profile_key=C.PROF_KEY_NONE, 1146 name, category, attr, security_limit, profile
1147 ): 1147 ))
1148 return self.params.asyncGetStringParamA( 1148
1149 name, category, attr, security_limit, profile_key 1149 def _getParamsUI(self, security_limit, app, extra_s, profile_key):
1150 ) 1150 return self.params._getParamsUI(security_limit, app, extra_s, profile_key)
1151
1152 def getParamsUI(
1153 self, security_limit=C.NO_SECURITY_LIMIT, app="", profile_key=C.PROF_KEY_NONE
1154 ):
1155 return self.params.getParamsUI(security_limit, app, profile_key)
1156 1151
1157 def getParamsCategories(self): 1152 def getParamsCategories(self):
1158 return self.params.getParamsCategories() 1153 return self.params.getParamsCategories()
1159 1154
1160 def setParam( 1155 def setParam(