From 6f8b5347dfa119a3df21f4ca8ba8c2b1537a726a Mon Sep 17 00:00:00 2001 From: RaNaN Date: Sun, 6 Jan 2013 15:54:52 +0100 Subject: first working parts of config api --- module/database/ConfigDatabase.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'module/database') diff --git a/module/database/ConfigDatabase.py b/module/database/ConfigDatabase.py index 7dd5909b8..2e9fdd9a0 100644 --- a/module/database/ConfigDatabase.py +++ b/module/database/ConfigDatabase.py @@ -42,6 +42,16 @@ class ConfigMethods(DatabaseMethods): return configs + @queue + def loadConfigsForUser(self, user=None): + if user is None: user = -1 + self.c.execute('SELECT plugin, config FROM settings WHERE user=?', (user,)) + configs = {} + for r in self.c: + configs[r[0]] = r[1] + + return configs + @async def clearAllConfigs(self): self.c.execute('DELETE FROM settings') -- cgit v1.2.3