summaryrefslogtreecommitdiffstats
path: root/module/AccountManager.py
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2010-10-03 20:53:22 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2010-10-03 20:53:22 +0200
commit405aa7a9953481a39a4f08f3677fbe9e1523f997 (patch)
treea62686503ac94118b2f282c34c00512dabff0339 /module/AccountManager.py
parentshareonline expire date fix (diff)
downloadpyload-405aa7a9953481a39a4f08f3677fbe9e1523f997.tar.xz
time settings for accounts
Diffstat (limited to 'module/AccountManager.py')
-rw-r--r--module/AccountManager.py15
1 files changed, 6 insertions, 9 deletions
diff --git a/module/AccountManager.py b/module/AccountManager.py
index 7ef986600..5dedacf3c 100644
--- a/module/AccountManager.py
+++ b/module/AccountManager.py
@@ -103,14 +103,11 @@ class AccountManager():
elif line.startswith("@"):
option = line[1:].split()
- self.accounts[plugin][name]["options"].append(tuple(option))
+ self.accounts[plugin][name]["options"][option[0]] = [option[1]] if len(option) < 3 else option[1:]
elif ":" in line:
- name, sep,pw = line.partition(":")
- self.accounts[plugin][name] = {"password": pw, "options": [], "valid": True}
-
-
-
+ name, sep, pw = line.partition(":")
+ self.accounts[plugin][name] = {"password": pw, "options": {}, "valid": True}
#----------------------------------------------------------------------
def saveAccounts(self):
"""save all account information"""
@@ -124,8 +121,8 @@ class AccountManager():
for name,data in accounts.iteritems():
f.write("\n\t%s:%s\n" % (name,data["password"]) )
- for option in data["options"]:
- f.write("\t@%s\n" % " ".join(option) )
+ for option, values in data["options"].iteritems():
+ f.write("\t@%s %s\n" % (option, " ".join(values)))
f.close()
@@ -137,7 +134,7 @@ class AccountManager():
self.accounts[name] = {}
#----------------------------------------------------------------------
- def updateAccount(self, plugin , user, password, options):
+ def updateAccount(self, plugin , user, password=None, options={}):
"""add or update account"""
if self.accounts.has_key(plugin):
p = self.getAccountPlugin(plugin)