diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-11-07 23:03:29 +0100 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-11-07 23:03:29 +0100 |
commit | 624fd1d349f409c4a57beead710e4263c3984c4a (patch) | |
tree | 5943248c9066b081712ec026798d78f32456b865 /module/AccountManager.py | |
parent | ... just forgot something (diff) | |
download | pyload-624fd1d349f409c4a57beead710e4263c3984c4a.tar.xz |
account cache fix
Diffstat (limited to 'module/AccountManager.py')
-rw-r--r-- | module/AccountManager.py | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/module/AccountManager.py b/module/AccountManager.py index a76a9915a..4151f529c 100644 --- a/module/AccountManager.py +++ b/module/AccountManager.py @@ -36,7 +36,6 @@ class AccountManager(): self.accounts = {} # key = ( plugin ) self.plugins = {} - self.accountInfoCache = {} self.initAccountPlugins() @@ -155,21 +154,17 @@ class AccountManager(): p = self.getAccountPlugin(plugin) p.removeAccount(user) - if self.accounts.has_key(p): - if self.accounts[p].has_key(user): - del self.accounts[p][user] - self.saveAccounts() p.getAllAccounts(force=True) self.core.scheduler.addJob(0, self.core.accountManager.getAccountInfos) - - def getCachedAccountInfos(self, refresh=True): + + + def getAccountInfos(self, force=True, refresh=False): + data = {} + if refresh: self.core.scheduler.addJob(0, self.core.accountManager.getAccountInfos) - return self.accountInfoCache - - def getAccountInfos(self, force=True): - data = {} + force = False for p in self.accounts.keys(): if self.accounts[p]: @@ -177,7 +172,6 @@ class AccountManager(): data[p.__name__] = p.getAllAccounts(force) else: data[p] = [] - self.accountInfoCache = data e = AccountUpdateEvent() self.core.pullManager.addEvent(e) return data |