X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/6c7144777d4e9001792e2843e9891f861b45dab9..be664ec6f26b751c9163c5767d254ca9ceed5b99:/lib/python/Components/config.py 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)