summaryrefslogtreecommitdiffstats
path: root/module/ConfigParser.py
diff options
context:
space:
mode:
Diffstat (limited to 'module/ConfigParser.py')
-rw-r--r--module/ConfigParser.py20
1 files changed, 13 insertions, 7 deletions
diff --git a/module/ConfigParser.py b/module/ConfigParser.py
index b445dfb3e..78b612f13 100644
--- a/module/ConfigParser.py
+++ b/module/ConfigParser.py
@@ -8,8 +8,6 @@ from shutil import copy
from traceback import print_exc
from utils import chmod
-from module.common.OrderedDict import OrderedDict
-
# ignore these plugin configs, mainly because plugins were wiped out
IGNORE = (
"FreakshareNet", "SpeedManager", "ArchiveTo", "ShareCx", ('hooks', 'UnRar'),
@@ -320,7 +318,13 @@ class ConfigParser:
def addPluginConfig(self, name, config, outline=""):
"""adds config options with tuples (name, type, desc, default)"""
- conf = self.plugin[name] if name in self.plugin else {}
+ if name not in self.plugin:
+ conf = {"desc": name,
+ "outline": outline}
+ self.plugin[name] = conf
+ else:
+ conf = self.plugin[name]
+ conf["outline"] = outline
for item in config:
if item[0] in conf:
@@ -332,10 +336,12 @@ class ConfigParser:
"type": item[1],
"value": self.cast(item[1], item[3])
}
-
- #filter out values not used any more
- self.plugin[name] = OrderedDict((("desc", name), ("outline", outline)))
- self.plugin[name].update(((x[0], conf[x[0]]) for x in config))
+
+ values = [x[0] for x in config] + ["desc", "outline"]
+ #delete old values
+ for item in conf.keys():
+ if item not in values:
+ del conf[item]
def deleteConfig(self, name):
"""Removes a plugin config"""