summaryrefslogtreecommitdiffstats
path: root/module/database
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2013-01-06 15:54:52 +0100
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2013-01-06 15:54:52 +0100
commit6f8b5347dfa119a3df21f4ca8ba8c2b1537a726a (patch)
tree627c4d99f0aaa4c8022b70b3ebe72f201d924dd6 /module/database
parentremoved unneeded stuff (diff)
downloadpyload-6f8b5347dfa119a3df21f4ca8ba8c2b1537a726a.tar.xz
first working parts of config api
Diffstat (limited to 'module/database')
-rw-r--r--module/database/ConfigDatabase.py10
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')