diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2011-01-01 13:40:51 +0100 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2011-01-01 13:40:51 +0100 |
commit | 65c01483993750b365cb5ae19ecb4ce339565575 (patch) | |
tree | 9d5380abf465c2861958ba1a77c2bbd4b7cebe6f /module/ConfigParser.py | |
parent | Happy new Year !!! (diff) | |
download | pyload-65c01483993750b365cb5ae19ecb4ce339565575.tar.xz |
closed #200
Diffstat (limited to 'module/ConfigParser.py')
-rw-r--r-- | module/ConfigParser.py | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/module/ConfigParser.py b/module/ConfigParser.py index 0d681551a..e3e5d103a 100644 --- a/module/ConfigParser.py +++ b/module/ConfigParser.py @@ -13,7 +13,6 @@ IGNORE = ("FreakshareNet", "SpeedManager") CONF_VERSION = 1 -######################################################################## class ConfigParser: """ holds and manage the configuration @@ -301,7 +300,14 @@ class ConfigParser: #---------------------------------------------------------------------- def get(self, section, option): """get value""" - return self.config[section][option]["value"] + val = self.config[section][option]["value"] + try: + if type(val) in (str,unicode): + return val.decode("utf8") + else: + return val + except: + return val #---------------------------------------------------------------------- def set(self, section, option, value): @@ -315,7 +321,14 @@ class ConfigParser: #---------------------------------------------------------------------- def getPlugin(self, plugin, option): """gets a value for a plugin""" - return self.plugin[plugin][option]["value"] + val = self.plugin[plugin][option]["value"] + try: + if type(val) in (str, unicode): + return val.decode("utf8") + else: + return val + except: + return val #---------------------------------------------------------------------- def setPlugin(self, plugin, option, value): |