diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-08-12 11:47:23 +0200 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-08-12 11:47:23 +0200 |
commit | 46bac1946a3d3f8346517e9a42da457646074c44 (patch) | |
tree | 2b572a2af0852bbb03c2cd372457772d8ee5a3ae /module/AccountManager.py | |
parent | renaming fix, get job by priority (diff) | |
download | pyload-46bac1946a3d3f8346517e9a42da457646074c44.tar.xz |
account fixes
Diffstat (limited to 'module/AccountManager.py')
-rw-r--r-- | module/AccountManager.py | 27 |
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() |