summaryrefslogtreecommitdiffstats
path: root/module/gui/CoreConfigParser.py
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@gmail.com> 2014-04-10 13:37:02 +0200
committerGravatar Walter Purcaro <vuolter@gmail.com> 2014-06-28 02:51:58 +0200
commit2ff2fb0495febe11d5015d2308d67e1d8048e597 (patch)
tree2ae9d1da4a701fc6b3945ccc32dfbbf102b9c85a /module/gui/CoreConfigParser.py
parentLocalization badge (diff)
downloadpyload-2ff2fb0495febe11d5015d2308d67e1d8048e597.tar.xz
Some code cosmetics about commas, spaces and quotes
Merges #577
Diffstat (limited to 'module/gui/CoreConfigParser.py')
-rw-r--r--module/gui/CoreConfigParser.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/module/gui/CoreConfigParser.py b/module/gui/CoreConfigParser.py
index 84910da1a..cf0c24868 100644
--- a/module/gui/CoreConfigParser.py
+++ b/module/gui/CoreConfigParser.py
@@ -52,7 +52,7 @@ class ConfigParser:
conf = {}
- section, option, value, typ, desc = "","","","",""
+ section, option, value, typ, desc = "", "", "", "", ""
listmode = False
@@ -75,20 +75,20 @@ class ConfigParser:
section, none, desc = line[:-1].partition('-')
section = section.strip()
desc = desc.replace('"', "").strip()
- conf[section] = { "desc" : desc }
+ conf[section] = {"desc": desc}
else:
if listmode:
if line.endswith("]"):
listmode = False
- line = line.replace("]","")
+ line = line.replace("]", "")
value += [self.cast(typ, x.strip()) for x in line.split(",") if x]
if not listmode:
- conf[section][option] = { "desc" : desc,
- "type" : typ,
- "value" : value}
+ conf[section][option] = {"desc": desc,
+ "type": typ,
+ "value": value}
else:
content, none, value = line.partition("=")
@@ -113,9 +113,9 @@ class ConfigParser:
value = self.cast(typ, value)
if not listmode:
- conf[section][option] = { "desc" : desc,
- "type" : typ,
- "value" : value}
+ conf[section][option] = {"desc": desc,
+ "type": typ,
+ "value": value}
except:
pass
@@ -132,7 +132,7 @@ class ConfigParser:
if typ == "int":
return int(value)
elif typ == "bool":
- return True if value.lower() in ("1","true", "on", "an","yes") else False
+ return True if value.lower() in ("1", "true", "on", "an", "yes") else False
else:
return value