diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2013-01-06 15:54:52 +0100 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2013-01-06 15:54:52 +0100 |
commit | 6f8b5347dfa119a3df21f4ca8ba8c2b1537a726a (patch) | |
tree | 627c4d99f0aaa4c8022b70b3ebe72f201d924dd6 /module/database | |
parent | removed unneeded stuff (diff) | |
download | pyload-6f8b5347dfa119a3df21f4ca8ba8c2b1537a726a.tar.xz |
first working parts of config api
Diffstat (limited to 'module/database')
-rw-r--r-- | module/database/ConfigDatabase.py | 10 |
1 files changed, 10 insertions, 0 deletions
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') |