core: fix for methods signature

This commit is contained in:
souliane 2013-09-08 15:00:15 +02:00
commit 75c414afde

View file

@ -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):