summaryrefslogtreecommitdiffstats
path: root/module/config/ConfigParser.py
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-12-20 21:35:43 +0100
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-12-20 21:35:43 +0100
commitc9a359b75905d4910e42127cef8cbe62d4a13657 (patch)
tree28f878ece7c333f19d163ae698202c88bd2297f5 /module/config/ConfigParser.py
parentMerged in hzpz/pyload (pull request #10) (diff)
downloadpyload-c9a359b75905d4910e42127cef8cbe62d4a13657.tar.xz
some bugfixes
Diffstat (limited to 'module/config/ConfigParser.py')
-rw-r--r--module/config/ConfigParser.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/module/config/ConfigParser.py b/module/config/ConfigParser.py
index 01f4268cb..33b3d26b6 100644
--- a/module/config/ConfigParser.py
+++ b/module/config/ConfigParser.py
@@ -102,7 +102,7 @@ class ConfigParser:
continue
if name in self.config[section].config:
- self.set(section, name, value)
+ self.set(section, name, value, sync=False)
else:
print "Unrecognized option", section, name
@@ -147,7 +147,7 @@ class ConfigParser:
else:
return self.config[section].config[option].default
- def set(self, section, option, value):
+ def set(self, section, option, value, sync=True):
"""set value"""
data = self.config[section].config[option]
@@ -156,8 +156,9 @@ class ConfigParser:
# only save when different to defaul values
if value != data.default or (option in self.values[section] and value != self.values[section][option]):
self.values[section][option] = value
- if self.changeCB: self.changeCB(section, option, value)
- self.save()
+ if sync:
+ if self.changeCB: self.changeCB(section, option, value)
+ self.save()
def getPlugin(self, *args):
"""gets a value for a plugin"""
@@ -204,7 +205,7 @@ class ConfigParser:
d[conf_name] = ConfigData(gettext(conf_desc), type, gettext(conf_verbose), from_string(default, type))
if base:
- self.baseSections.append(section)
+ if section not in self.baseSections: self.baseSections.append(section)
else:
if section in self.config:
print "Section already exists", section