From 69122abc3e2156e3b3a9a82f4ab5b0b68f694aad Mon Sep 17 00:00:00 2001 From: Necoro <> Date: Mon, 12 Nov 2007 20:03:35 +0000 Subject: r543@Devoty: necoro | 2007-11-12 21:02:39 +0100 Added saved preferences --- portato/config_parser.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'portato/config_parser.py') 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 -- cgit v1.2.3