summaryrefslogtreecommitdiffstats
path: root/module/database
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-12-19 23:10:49 +0100
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-12-19 23:10:49 +0100
commit6eae782f13953dd0ba2bbe1b582cf33fd4d7d90a (patch)
treea7e80bc89b1a523854e1f3e3d9ec945023193212 /module/database
parentpluginmanager cleanup (diff)
downloadpyload-6eae782f13953dd0ba2bbe1b582cf33fd4d7d90a.tar.xz
configparser v2, warning CONFIG will be DELETED.
Diffstat (limited to 'module/database')
-rw-r--r--module/database/DatabaseBackend.py40
1 files changed, 4 insertions, 36 deletions
diff --git a/module/database/DatabaseBackend.py b/module/database/DatabaseBackend.py
index 9530390c3..db8b1aa3c 100644
--- a/module/database/DatabaseBackend.py
+++ b/module/database/DatabaseBackend.py
@@ -138,7 +138,6 @@ class DatabaseBackend(Thread):
self._convertDB(convert)
self._createTables()
- self._migrateUser()
self.conn.commit()
@@ -191,22 +190,10 @@ class DatabaseBackend(Thread):
print "Filedatabase could NOT be converted."
#--convert scripts start
-
- def _convertV2(self):
- self.c.execute('CREATE TABLE IF NOT EXISTS "storage" ("id" INTEGER PRIMARY KEY AUTOINCREMENT, "identifier" TEXT NOT NULL, "key" TEXT NOT NULL, "value" TEXT DEFAULT "")')
- try:
- self.manager.core.log.info(_("Database was converted from v2 to v3."))
- except:
- print "Database was converted from v2 to v3."
- self._convertV3()
-
- def _convertV3(self):
- self.c.execute('CREATE TABLE IF NOT EXISTS "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT, "name" TEXT NOT NULL, "email" TEXT DEFAULT "" NOT NULL, "password" TEXT NOT NULL, "role" INTEGER DEFAULT 0 NOT NULL, "permission" INTEGER DEFAULT 0 NOT NULL, "template" TEXT DEFAULT "default" NOT NULL)')
- try:
- self.manager.core.log.info(_("Database was converted from v3 to v4."))
- except:
- print "Database was converted from v3 to v4."
-
+
+ def _convertV4(self):
+ pass
+
#--convert scripts end
def _createTables(self):
@@ -246,25 +233,6 @@ class DatabaseBackend(Thread):
self.c.execute('VACUUM')
- def _migrateUser(self):
- if exists("pyload.db"):
- try:
- self.core.log.info(_("Converting old Django DB"))
- except:
- print "Converting old Django DB"
- conn = sqlite3.connect('pyload.db')
- c = conn.cursor()
- c.execute("SELECT username, password, email from auth_user WHERE is_superuser")
- users = []
- for r in c:
- pw = r[1].split("$")
- users.append((r[0], pw[1] + pw[2], r[2]))
- c.close()
- conn.close()
-
- self.c.executemany("INSERT INTO users(name, password, email) VALUES (?, ?, ?)", users)
- move("pyload.db", "pyload.old.db")
-
def createCursor(self):
return self.conn.cursor()