diff options
Diffstat (limited to '')
-rw-r--r-- | portato/config_parser.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/portato/config_parser.py b/portato/config_parser.py index 51592a8..eb0d42a 100644 --- a/portato/config_parser.py +++ b/portato/config_parser.py @@ -153,7 +153,7 @@ class ConfigParser: """Private method which initializes our dictionaries.""" self.vars = {"MAIN": {}} - self.cache = None # file cache + self.cache = [] # file cache self.pos = {} # stores the positions of the matches self.sections = {"MAIN" : -1} # the line with the section header @@ -326,6 +326,9 @@ class ConfigParser: section = section.upper() key = key.lower() + if key in self.vars[section]: + return self.set(key, value, section) + self.write() # find line# to add |