From 9d8db8ae95434e94e745854d30bf624791151553 Mon Sep 17 00:00:00 2001 From: Andreas Monzner Date: Fri, 27 Jan 2006 23:22:45 +0000 Subject: [PATCH] revert getKey change.. --- lib/python/Components/config.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) 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) -- 2.30.2