From bc12e7c71cc93bcc22f80dba15111091b4528e03 Mon Sep 17 00:00:00 2001 From: mkaay Date: Thu, 12 Aug 2010 00:51:10 +0200 Subject: account plugin change, server methods for accounts --- pyLoadCore.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'pyLoadCore.py') diff --git a/pyLoadCore.py b/pyLoadCore.py index 11cd0241a..246bdadc6 100755 --- a/pyLoadCore.py +++ b/pyLoadCore.py @@ -608,14 +608,28 @@ class ServerMethods(): def get_events(self, uuid): return self.core.pullManager.getEvents(uuid) - def get_premium_accounts(self): - #@TODO implement + def get_accounts(self): plugins = self.core.pluginManager.getAccountPlugins() data = [] for p in plugins: data.extend(p.getAllAccounts()) return data + def update_account(self, plugin, account, password): + """ create and update account """ + plugins = self.core.pluginManager.getAccountPlugins() + for p in plugins: + if p.__name__ == plugin: + p.updateAccount(account, password) + break + + def remove_account(self, plugin, account, password): + plugins = self.core.pluginManager.getAccountPlugins() + for p in plugins: + if p.__name__ == plugin: + p.removeAccount(account, password) + break + def set_priority(self, id, priority): p = self.core.files.getPackage(id) p.setPriority(priority) -- cgit v1.2.3