summaryrefslogtreecommitdiffstats
path: root/module/plugins/AccountManager.py
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-06-12 13:13:20 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-06-12 13:13:20 +0200
commit6a86b735fb9723239f4d109e2a2985b7782807dc (patch)
treeeca7ced4fb3dd300611fc831c0eccb9a5536a64c /module/plugins/AccountManager.py
parentcomment out filemanager (diff)
downloadpyload-6a86b735fb9723239f4d109e2a2985b7782807dc.tar.xz
erniebs fixes, ul lifetime fix
Diffstat (limited to 'module/plugins/AccountManager.py')
-rw-r--r--module/plugins/AccountManager.py12
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 = {}