From e655d860882fff63160098f063fc3e4c9b8c0ba5 Mon Sep 17 00:00:00 2001 From: RaNaN Date: Thu, 12 Aug 2010 19:42:46 +0200 Subject: web if acc settings --- module/AccountManager.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'module/AccountManager.py') diff --git a/module/AccountManager.py b/module/AccountManager.py index 0122b0223..fc122e760 100644 --- a/module/AccountManager.py +++ b/module/AccountManager.py @@ -51,7 +51,14 @@ class AccountManager(): else: return None - + def getAccountPlugins(self): + """ get all account instances""" + + plugins = [] + for plugin in self.accounts.keys(): + plugins.append(self.getAccountPlugin(plugin)) + + return plugins #---------------------------------------------------------------------- def loadAccounts(self): """loads all accounts available""" @@ -107,7 +114,7 @@ class AccountManager(): f = open("accounts.conf", "wb") f.write("version: " + str(ACC_VERSION) + "\n") - + for plugin, accounts in self.accounts.iteritems(): f.write("\n") f.write(plugin+":\n") @@ -145,11 +152,12 @@ class AccountManager(): #---------------------------------------------------------------------- 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] + if self.accounts[plugin].has_key(user): + del self.accounts[plugin][user] self.saveAccounts() -- cgit v1.2.3