core: better management of default value in getConfig

This commit is contained in:
Goffi 2014-10-07 17:12:41 +02:00
commit 6b20989ecc

View file

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