summaryrefslogtreecommitdiffstats
path: root/module/database
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2012-09-09 15:39:50 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2012-09-09 15:39:50 +0200
commit560958b70043ea5b7e0e32d41cb51bd44696d775 (patch)
tree948384effdf884301f7b4cf07ab8de95a147b600 /module/database
parentlittle logo update (diff)
downloadpyload-560958b70043ea5b7e0e32d41cb51bd44696d775.tar.xz
new config api
Diffstat (limited to 'module/database')
-rw-r--r--module/database/ConfigDatabase.py28
-rw-r--r--module/database/DatabaseBackend.py6
-rw-r--r--module/database/FileDatabase.py2
3 files changed, 32 insertions, 4 deletions
diff --git a/module/database/ConfigDatabase.py b/module/database/ConfigDatabase.py
new file mode 100644
index 000000000..cc24f6785
--- /dev/null
+++ b/module/database/ConfigDatabase.py
@@ -0,0 +1,28 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+from module.database import DatabaseMethods, queue, async, inner
+
+# TODO
+
+class ConfigMethods(DatabaseMethods):
+
+ @async
+ def saveConfig(self, plugin, user, config):
+ pass
+
+ @queue
+ def loadConfig(self, plugin, user):
+ pass
+
+ @async
+ def deleteConfig(self, plugin, user):
+ pass
+
+ @queue
+ def loadAllConfigs(self):
+ pass
+
+
+
+ConfigMethods.register() \ No newline at end of file
diff --git a/module/database/DatabaseBackend.py b/module/database/DatabaseBackend.py
index 2c494e520..3e6b059c0 100644
--- a/module/database/DatabaseBackend.py
+++ b/module/database/DatabaseBackend.py
@@ -352,10 +352,10 @@ class DatabaseBackend(Thread):
self.c.execute(
'CREATE TABLE IF NOT EXISTS "settings" ('
'"plugin" TEXT NOT NULL, '
- '"owner" INTEGER NOT NULL, '
- '"configuration" TEXT NOT NULL, '
+ '"user" INTEGER NOT NULL, '
+ '"config" TEXT NOT NULL, '
'FOREIGN KEY(owner) REFERENCES users(uid), '
- 'PRIMARY KEY (plugin, owner) ON CONFLICT REPLACE'
+ 'PRIMARY KEY (plugin, user) ON CONFLICT REPLACE'
')'
)
diff --git a/module/database/FileDatabase.py b/module/database/FileDatabase.py
index ab681dc7f..e065b84e2 100644
--- a/module/database/FileDatabase.py
+++ b/module/database/FileDatabase.py
@@ -75,7 +75,7 @@ class FileMethods(DatabaseMethods):
@async
def deletePackage(self, pid, owner=None):
- # order updated by trigge
+ # order updated by trigger, as well as links deleted
if owner is None:
self.c.execute('DELETE FROM packages WHERE pid=?', (pid,))
else: