diff src/memory/memory.py @ 1234:9c17bd37e6e5

core: better management of default value in getConfig
author Goffi <goffi@goffi.org>
date Tue, 07 Oct 2014 17:12:41 +0200
parents f0c9b149ed99
children 22adf1eb59f5
line wrap: on
line diff
--- a/src/memory/memory.py	Mon Oct 06 17:25:41 2014 +0200
+++ b/src/memory/memory.py	Tue Oct 07 17:12:41 2014 +0200
@@ -226,12 +226,15 @@
             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