summaryrefslogtreecommitdiffstats
path: root/module/AccountManager.py
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2010-08-12 11:47:23 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2010-08-12 11:47:23 +0200
commit46bac1946a3d3f8346517e9a42da457646074c44 (patch)
tree2b572a2af0852bbb03c2cd372457772d8ee5a3ae /module/AccountManager.py
parentrenaming fix, get job by priority (diff)
downloadpyload-46bac1946a3d3f8346517e9a42da457646074c44.tar.xz
account fixes
Diffstat (limited to 'module/AccountManager.py')
-rw-r--r--module/AccountManager.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/module/AccountManager.py b/module/AccountManager.py
index 5c3c99276..0122b0223 100644
--- a/module/AccountManager.py
+++ b/module/AccountManager.py
@@ -126,3 +126,30 @@ class AccountManager():
for name in self.core.pluginManager.getAccountPlugins():
self.accounts[name] = {}
+ #----------------------------------------------------------------------
+ def updateAccount(self, plugin , user, password, options):
+ """add or update account"""
+
+ if self.accounts.has_key(plugin):
+ p = self.getAccountPlugin(plugin)
+ p.updateAccounts(user, password, options)
+
+ if self.accounts[plugin].has_key(user):
+ self.accounts[plugin][user]["password"] = password
+ self.accounts[plugin][user]["options"] = options
+ else:
+ self.accounts[plugin][user] = {"password": password, "options": options}
+
+ self.saveAccounts()
+
+ #----------------------------------------------------------------------
+ def removeAccount(self, plugin, user):
+ """remove account"""
+ if self.accounts.has_key(plugin):
+ p = self.getAccountPlugin(plugin)
+ p.removeAccount(user)
+
+ if self.accounts.has_key(user):
+ del self.accounts[user]
+
+ self.saveAccounts()