diff options
author | 2011-06-12 13:13:20 +0200 | |
---|---|---|
committer | 2011-06-12 13:13:20 +0200 | |
commit | 6a86b735fb9723239f4d109e2a2985b7782807dc (patch) | |
tree | eca7ced4fb3dd300611fc831c0eccb9a5536a64c /module/plugins/AccountManager.py | |
parent | comment out filemanager (diff) | |
download | pyload-6a86b735fb9723239f4d109e2a2985b7782807dc.tar.xz |
erniebs fixes, ul lifetime fix
Diffstat (limited to 'module/plugins/AccountManager.py')
-rw-r--r-- | module/plugins/AccountManager.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/module/plugins/AccountManager.py b/module/plugins/AccountManager.py index e4c858a43..94af7cd82 100644 --- a/module/plugins/AccountManager.py +++ b/module/plugins/AccountManager.py @@ -20,12 +20,13 @@ from os.path import exists from shutil import copy +from threading import Lock + from module.PullEvents import AccountUpdateEvent -from module.utils import chmod +from module.utils import chmod, lock ACC_VERSION = 1 -######################################################################## class AccountManager(): """manages all accounts""" @@ -37,6 +38,7 @@ class AccountManager(): self.accounts = {} # key = ( plugin ) self.plugins = {} + self.lock = Lock() self.initAccountPlugins() @@ -138,7 +140,7 @@ class AccountManager(): for name in self.core.pluginManager.getAccountPlugins(): self.accounts[name] = {} - #---------------------------------------------------------------------- + @lock def updateAccount(self, plugin , user, password=None, options={}): """add or update account""" if self.accounts.has_key(plugin): @@ -149,7 +151,7 @@ class AccountManager(): self.saveAccounts() if updated: p.scheduleRefresh(user, force=False) - #---------------------------------------------------------------------- + @lock def removeAccount(self, plugin, user): """remove account""" @@ -159,7 +161,7 @@ class AccountManager(): self.saveAccounts() - + @lock def getAccountInfos(self, force=True, refresh=False): data = {} |