# HG changeset patch # User souliane # Date 1378645215 -7200 # Node ID e07a03d52321b1b1d34020490e873a11e504e599 # Parent 49587e170f53ab3c066007d46d995f874f7b7a07 core: fix for methods signature diff -r 49587e170f53 -r e07a03d52321 src/memory/memory.py --- a/src/memory/memory.py Sat Sep 07 02:03:17 2013 +0200 +++ b/src/memory/memory.py Sun Sep 08 15:00:15 2013 +0200 @@ -33,7 +33,7 @@ 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 @@ 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 @@ 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 @@ 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):