summaryrefslogtreecommitdiffstats
path: root/pyload/config
diff options
context:
space:
mode:
Diffstat (limited to 'pyload/config')
-rw-r--r--pyload/config/Parser.py38
-rw-r--r--pyload/config/default.conf14
2 files changed, 25 insertions, 27 deletions
diff --git a/pyload/config/Parser.py b/pyload/config/Parser.py
index bad512a5f..ed81d041c 100644
--- a/pyload/config/Parser.py
+++ b/pyload/config/Parser.py
@@ -91,8 +91,8 @@ class ConfigParser(object):
homeconf = self.parseConfig("pyload.conf")
if "username" in homeconf["remote"]:
if "password" in homeconf["remote"]:
- self.oldRemoteData = {"username": homeconf["remote"]["username"]["value"],
- "password": homeconf["remote"]["username"]["value"]}
+ self.oldRemoteData = {"username": homeconf["remote"]["username"]['value'],
+ "password": homeconf["remote"]["username"]['value']}
del homeconf["remote"]["password"]
del homeconf["remote"]["username"]
self.updateValues(homeconf, self.config)
@@ -159,7 +159,7 @@ class ConfigParser(object):
typ, none, option = content.strip().rpartition(" ")
value = value.strip()
- typ = typ.strip()
+ typ = typ.strip()
if value.startswith("["):
if value.endswith("]"):
@@ -195,7 +195,7 @@ class ConfigParser(object):
continue
if option in dest[section]:
- dest[section][option]["value"] = config[section][option]["value"]
+ dest[section][option]['value'] = config[section][option]['value']
# else:
# dest[section][option] = config[section][option]
@@ -216,20 +216,20 @@ class ConfigParser(object):
for option, data in config[section].iteritems():
if option in ("desc", "outline"): continue
- if isinstance(data["value"], list):
+ if isinstance(data['value'], list):
value = "[ \n"
- for x in data["value"]:
+ for x in data['value']:
value += "\t\t" + str(x) + ",\n"
value += "\t\t]\n"
else:
- if isinstance(data["value"], basestring):
- value = data["value"] + "\n"
+ if isinstance(data['value'], basestring):
+ value = data['value'] + "\n"
else:
- value = str(data["value"]) + "\n"
+ value = str(data['value']) + "\n"
try:
- f.write('\t%s %s : "%s" = %s' % (data["type"], option, data["desc"], value))
+ f.write('\t%s %s : "%s" = %s' % (data['type'], option, data["desc"], value))
except UnicodeEncodeError:
- f.write('\t%s %s : "%s" = %s' % (data["type"], option, data["desc"], encode(value)))
+ f.write('\t%s %s : "%s" = %s' % (data['type'], option, data["desc"], encode(value)))
def cast(self, typ, value):
@@ -266,33 +266,31 @@ class ConfigParser(object):
def get(self, section, option):
"""get value"""
- value = self.config[section][option]["value"]
+ value = self.config[section][option]['value']
return decode(value)
def set(self, section, option, value):
"""set value"""
-
- value = self.cast(self.config[section][option]["type"], value)
-
- self.config[section][option]["value"] = value
+ value = self.cast(self.config[section][option]['type'], value)
+ self.config[section][option]['value'] = value
self.save()
def getPlugin(self, plugin, option):
"""gets a value for a plugin"""
- value = self.plugin[plugin][option]["value"]
+ value = self.plugin[plugin][option]['value']
return encode(value)
def setPlugin(self, plugin, option, value):
"""sets a value for a plugin"""
- value = self.cast(self.plugin[plugin][option]["type"], value)
+ value = self.cast(self.plugin[plugin][option]['type'], value)
if self.pluginCB: self.pluginCB(plugin, option, value)
- self.plugin[plugin][option]["value"] = value
+ self.plugin[plugin][option]['value'] = value
self.save()
@@ -319,7 +317,7 @@ class ConfigParser(object):
for item in config:
if item[0] in conf:
- conf[item[0]]["type"] = item[1]
+ conf[item[0]]['type'] = item[1]
conf[item[0]]["desc"] = item[2]
else:
conf[item[0]] = {
diff --git a/pyload/config/default.conf b/pyload/config/default.conf
index 453c40b4b..e07b92f68 100644
--- a/pyload/config/default.conf
+++ b/pyload/config/default.conf
@@ -21,13 +21,13 @@ webui - "Web User Interface":
str prefix : "Path Prefix" = None
log - "Log":
- bool file_log : "File Log" = True
- folder log_folder : "Folder" = Logs
- int log_count : "Count" = 5
- int log_size : "Size in kb" = 100
- bool log_rotate : "Log Rotate" = True
- bool color_console : "Colored console" = True
- label;full color_template : "Color template" = label
+ bool file_log : "File Log" = True
+ folder log_folder : "Folder" = Logs
+ int log_count : "Count" = 5
+ int log_size : "Size in kb" = 100
+ bool log_rotate : "Log Rotate" = True
+ bool color_console : "Colored console" = True
+ label;line;mixed color_template : "Color template" = mixed
general - "General":
en;de;fr;it;es;nl;sv;ru;pl;cs;sr;pt_BR language : "Language" = en