From 75c414afde0318d1a589550d9bc9f9fd38950825 Mon Sep 17 00:00:00 2001 From: souliane Date: Sun, 8 Sep 2013 15:00:15 +0200 Subject: [PATCH] core: fix for methods signature --- src/memory/memory.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/memory/memory.py b/src/memory/memory.py index e2ae59c6..c7ff8f00 100644 --- a/src/memory/memory.py +++ b/src/memory/memory.py @@ -33,7 +33,7 @@ from sat.core import exceptions SAVEFILE_PARAM_XML = "/param" # xml parameters template SAVEFILE_DATABASE = "/sat.db" - +NO_SECURITY_LIMIT = -1 class Params(object): """This class manage parameters with xml""" @@ -377,9 +377,9 @@ class Params(object): def __constructProfileXml(self, security_limit, profile): """Construct xml for asked profile, filling values when needed /!\ as noticed in doc, don't forget to unlink the minidom.Document - @security_limit: -1 to return all the params. Otherwise sole the - params which have a security level defined *and* lower or equal to - the specified value are returned. + @security_limit: NO_SECURITY_LIMIT (-1) to return all the params. + Otherwise sole the params which have a security level defined *and* + lower or equal to the specified value are returned. @param profile: profile name (not key !) @return: a deferred that fire a minidom.Document of the profile xml (cf warning above) """ @@ -545,7 +545,7 @@ class Params(object): categories.append(cat.getAttribute("name")) return categories - def setParam(self, name, value, category, security_limit=-1, profile_key='@NONE@'): + def setParam(self, name, value, category, security_limit=NO_SECURITY_LIMIT, profile_key='@NONE@'): """Set a parameter, return None if the parameter is not in param xml""" #TODO: use different behaviour depending of the data type (e.g. password encrypted) if profile_key != "@NONE@": @@ -920,19 +920,19 @@ class Memory(object): def asyncGetStringParamA(self, name, category, attr="value", profile_key='@NONE@'): return self.params.asyncGetStringParamA(name, category, attr, profile_key) - def getParamsUI(self, security_limit, profile_key): + def getParamsUI(self, security_limit=NO_SECURITY_LIMIT, profile_key='@NONE@'): return self.params.getParamsUI(security_limit, profile_key) - def getParams(self, security_limit, profile_key): + def getParams(self, security_limit=NO_SECURITY_LIMIT, profile_key='@NONE@'): return self.params.getParams(security_limit, profile_key) - def getParamsForCategory(self, category, security_limit, profile_key): + def getParamsForCategory(self, category, security_limit=NO_SECURITY_LIMIT, profile_key='@NONE@'): return self.params.getParamsForCategory(category, security_limit, profile_key) def getParamsCategories(self): return self.params.getParamsCategories() - def setParam(self, name, value, category, security_limit, profile_key): + def setParam(self, name, value, category, security_limit=NO_SECURITY_LIMIT, profile_key='@NONE@'): return self.params.setParam(name, value, category, security_limit, profile_key) def importParams(self, xml):