diff options
author | mkaay <mkaay@mkaay.de> | 2011-02-05 14:19:22 +0100 |
---|---|---|
committer | mkaay <mkaay@mkaay.de> | 2011-02-05 14:19:22 +0100 |
commit | 7c332ae610f7feca193ba50ea900f5a417681a7b (patch) | |
tree | e71f1ba6b8eb52f13c11289069d65288b17a111c /module/ConfigParser.py | |
parent | py 2.5 fix -> removed import (diff) | |
download | pyload-7c332ae610f7feca193ba50ea900f5a417681a7b.tar.xz |
created unified authentication system (same data for webinterface an GUI/CLI, multiple accounts)
Diffstat (limited to 'module/ConfigParser.py')
-rw-r--r-- | module/ConfigParser.py | 35 |
1 files changed, 6 insertions, 29 deletions
diff --git a/module/ConfigParser.py b/module/ConfigParser.py index e3e5d103a..a8ecf6324 100644 --- a/module/ConfigParser.py +++ b/module/ConfigParser.py @@ -39,11 +39,7 @@ class ConfigParser: """Constructor""" self.config = {} # the config values self.plugin = {} # the config for plugins - - self.username = "" - self.password = "" - #stored outside and may not modified - + self.oldRemoteData = {} self.checkVersion() @@ -98,20 +94,17 @@ class ConfigParser: try: homeconf = self.parseConfig("pyload.conf") + if homeconf["remote"].has_key("username"): + if homeconf["remote"].has_key("password"): + 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) except Exception, e: print "Config Warning" print_exc() - - self.username = self.config["remote"]["username"]["value"] - del self.config["remote"]["username"] - - self.password = self.config["remote"]["password"]["value"] - del self.config["remote"]["password"] - - #---------------------------------------------------------------------- def parseConfig(self, config): """parses a given configfile""" @@ -273,23 +266,7 @@ class ConfigParser: def save(self): """saves the configs to disk""" - self.config["remote"]["username"] = { - "desc" : "Username", - "type": "str", - "value": self.username - } - - self.config["remote"]["password"] = { - "desc" : "Password", - "type": "str", - "value": self.password - } - self.saveConfig(self.config, "pyload.conf") - - del self.config["remote"]["username"] - del self.config["remote"]["password"] - self.saveConfig(self.plugin, "plugin.conf") #---------------------------------------------------------------------- |