From: Andreas Monzner Date: Fri, 27 Jan 2006 23:22:45 +0000 (+0000) Subject: revert getKey change.. X-Git-Tag: 2.6.0~4248 X-Git-Url: https://git.cweiske.de/enigma2.git/commitdiff_plain/9d8db8ae95434e94e745854d30bf624791151553 revert getKey change.. --- diff --git a/lib/python/Components/config.py b/lib/python/Components/config.py index c06d3b72..06bb62a2 100644 --- a/lib/python/Components/config.py +++ b/lib/python/Components/config.py @@ -27,11 +27,9 @@ class configFile: x = line.find("=") if x > -1: self.configElements[line[:x]] = line[x + 1:-1] - + def getKey(self, key): - if self.configElements.has_key(key): - return self.configElements[key] - return None + return self.configElements[key] def setKey(self, key, value, isDefaultKey=False): self.changed = 1 @@ -558,7 +556,10 @@ class configElement: if self.value != defaultValue or self.saveDefaults: configfile.setKey(self.configPath, self.datatoFile(self.controlType, self.value)) else: - oldValue = configfile.getKey(self.configPath) + try: + oldValue = configfile.getKey(self.configPath) + except: + oldValue = None if oldValue is not None and oldValue != defaultValue: configfile.setKey(self.configPath, self.datatoFile(self.controlType, self.value), True)