diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-10-02 23:22:33 +0200 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-10-02 23:22:33 +0200 |
commit | b642f147c006366ed039b533d212b6c3e2c19a44 (patch) | |
tree | 7dc22fd673eb4525283be6a172d8c5947915b51a /module | |
parent | formated output (diff) | |
download | pyload-b642f147c006366ed039b533d212b6c3e2c19a44.tar.xz |
fixes
Diffstat (limited to 'module')
-rw-r--r-- | module/AccountManager.py | 10 | ||||
-rw-r--r-- | module/plugins/Account.py | 2 | ||||
-rw-r--r-- | module/web/pyload/views.py | 27 |
3 files changed, 19 insertions, 20 deletions
diff --git a/module/AccountManager.py b/module/AccountManager.py index 6fdc7864d..0ca3c75a8 100644 --- a/module/AccountManager.py +++ b/module/AccountManager.py @@ -142,9 +142,10 @@ class AccountManager(): if self.accounts.has_key(plugin): p = self.getAccountPlugin(plugin) p.updateAccounts(user, password, options) + #since accounts is a ref in plugin self.accounts doesnt need to be updated here self.saveAccounts() - self.getAccountInfos(force=True) + p.getAllAccounts(force=True) #---------------------------------------------------------------------- def removeAccount(self, plugin, user): @@ -153,12 +154,9 @@ class AccountManager(): if self.accounts.has_key(plugin): p = self.getAccountPlugin(plugin) p.removeAccount(user) - - if self.accounts[plugin].has_key(user): - del self.accounts[plugin][user] - + self.saveAccounts() - self.getAccountInfos(force=True) + p.getAllAccounts(force=True) def getAccountInfos(self, force=False): data = {} diff --git a/module/plugins/Account.py b/module/plugins/Account.py index 6260ac3c7..9295b78f1 100644 --- a/module/plugins/Account.py +++ b/module/plugins/Account.py @@ -117,7 +117,7 @@ class Account(): def selectAccount(self): """ returns an valid and account name""" usable = [] - for user,data in self.accounts: + for user,data in self.accounts.iteritems(): if not data["valid"]: continue for option, value in data["options"]: pass diff --git a/module/web/pyload/views.py b/module/web/pyload/views.py index cdf0e280f..b38f89b31 100644 --- a/module/web/pyload/views.py +++ b/module/web/pyload/views.py @@ -328,19 +328,20 @@ def config(request): messages.append(_("All options were set correctly.")) accs = settings.PYLOAD.get_accounts() - for user,data in accs.iteritems(): - if data["trafficleft"] == -1: - data["trafficleft"] = _("unlimited") - elif not data["trafficleft"]: - data["trafficleft"] = "" - - if data["validuntil"] == -1: - data["validuntil"] = _("unlimited") - elif not data["validuntil"]: - data["validuntil"] = "" - else: - t = localtime(data["validuntil"]) - data["validuntil"] = strftime("%d-%m-%Y",t) + for plugin,accounts in accs.iteritems(): + for user,data in accounts: + if data["trafficleft"] == -1: + data["trafficleft"] = _("unlimited") + elif not data["trafficleft"]: + data["trafficleft"] = "" + + if data["validuntil"] == -1: + data["validuntil"] = _("unlimited") + elif not data["validuntil"]: + data["validuntil"] = "" + else: + t = localtime(data["validuntil"]) + data["validuntil"] = strftime("%d-%m-%Y",t) return render_to_response(join(settings.TEMPLATE, 'settings.html'), RequestContext(request, {'conf': {'Plugin':plugin, 'General':conf, 'Accounts': accs}, 'errors': messages}, [status_proc])) |