core: better management of default value in getConfig
This commit is contained in:
parent
97630ccab9
commit
6b20989ecc
1 changed files with 21 additions and 11 deletions
|
|
@ -226,12 +226,15 @@ class Memory(object):
|
|||
log.error(_("Can't read main config !"))
|
||||
return config
|
||||
|
||||
def getConfig(self, section, name):
|
||||
def getConfig(self, section, name, default=None):
|
||||
"""Get the main configuration option
|
||||
|
||||
@param section: section of the config file (None or '' for DEFAULT)
|
||||
@param name: name of the option
|
||||
@param default: value to use if not found
|
||||
@return: str, list or dict
|
||||
"""
|
||||
return tools_config.getConfig(self.config, section, name, default='')
|
||||
return tools_config.getConfig(self.config, section, name, default)
|
||||
|
||||
def load_xml(self, filename):
|
||||
"""Load parameters template from xml file
|
||||
|
|
|
|||
Loading…
Reference in a new issue