diff src/core/sat_main.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 7d640c303140
children f8a8434dbac7
line wrap: on
line diff
--- a/src/core/sat_main.py	Mon Oct 06 17:25:41 2014 +0200
+++ b/src/core/sat_main.py	Tue Oct 07 17:12:41 2014 +0200
@@ -95,7 +95,7 @@
         self.bridge.register("getWaitingSub", self.memory.getWaitingSub)
         self.bridge.register("getWaitingConf", self.getWaitingConf)
         self.bridge.register("sendMessage", self._sendMessage)
-        self.bridge.register("getConfig", self.memory.getConfig)
+        self.bridge.register("getConfig", self._getConfig)
         self.bridge.register("setParam", self.setParam)
         self.bridge.register("getParamA", self.memory.getStringParamA)
         self.bridge.register("asyncGetParamA", self.memory.asyncGetStringParamA)
@@ -396,6 +396,15 @@
             raise exceptions.ProfileKeyUnknownError
         return [self.profiles[profile]]
 
+    def _getConfig(self, section, name):
+        """Get the main configuration option
+
+        @param section: section of the config file (None or '' for DEFAULT)
+        @param name: name of the option
+        @return: unicode representation of the option
+        """
+        return unicode(self.memory.getConfig(section, name, ''))
+
     ## Client management ##
 
     def setParam(self, name, value, category, security_limit, profile_key):