summaryrefslogtreecommitdiff
path: root/portato/config_parser.py
diff options
context:
space:
mode:
authorNecoro <>2007-11-12 20:03:35 +0000
committerNecoro <>2007-11-12 20:03:35 +0000
commit69122abc3e2156e3b3a9a82f4ab5b0b68f694aad (patch)
tree289cfdf5a99b9dfd39426e664128920935e86a47 /portato/config_parser.py
parent0b335d1dd85a8fc39b4cf08803d3e07e246ba6a3 (diff)
downloadportato-69122abc3e2156e3b3a9a82f4ab5b0b68f694aad.tar.gz
portato-69122abc3e2156e3b3a9a82f4ab5b0b68f694aad.tar.bz2
portato-69122abc3e2156e3b3a9a82f4ab5b0b68f694aad.zip
r543@Devoty: necoro | 2007-11-12 21:02:39 +0100
Added saved preferences
Diffstat (limited to 'portato/config_parser.py')
-rw-r--r--portato/config_parser.py5
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