summaryrefslogtreecommitdiffstats
path: root/pyload/Database
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-05-12 22:25:39 +0200
committerGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-05-12 22:25:39 +0200
commit971754eba93701cfb22bc4399a37debf238eddf1 (patch)
treee3a36023f93b73a1621de0c6c9503ccbb301fb03 /pyload/Database
parentFix dict generators for python 2.5 (diff)
downloadpyload-971754eba93701cfb22bc4399a37debf238eddf1.tar.xz
General fixup (1)
Diffstat (limited to 'pyload/Database')
-rw-r--r--pyload/Database/Backend.py9
-rw-r--r--pyload/Database/User.py2
2 files changed, 7 insertions, 4 deletions
diff --git a/pyload/Database/Backend.py b/pyload/Database/Backend.py
index 622880e65..846586417 100644
--- a/pyload/Database/Backend.py
+++ b/pyload/Database/Backend.py
@@ -9,12 +9,11 @@ except Exception:
import sqlite3
import Queue
+import os
import shutil
import threading
import traceback
-from pyload.utils import chmod
-
DB_VERSION = 4
@@ -138,7 +137,11 @@ class DatabaseBackend(threading.Thread):
convert = self._checkVersion() #: returns None or current version
self.conn = sqlite3.connect("files.db")
- os.chmod("files.db", 0600)
+
+ try:
+ os.chmod("files.db", 0600)
+ except Exception:
+ pass
self.c = self.conn.cursor() #: compatibility
diff --git a/pyload/Database/User.py b/pyload/Database/User.py
index b895a4e12..83ee66b93 100644
--- a/pyload/Database/User.py
+++ b/pyload/Database/User.py
@@ -82,7 +82,7 @@ class UserMethods(object):
@style.queue
def getAllUserData(db):
db.c.execute("SELECT name, permission, role, template, email FROM users")
- return dict(r[0], {"permission": r[1], "role": r[2], "template": r[3], "email": r[4]}) for r in db.c)
+ return dict((r[0], {"permission": r[1], "role": r[2], "template": r[3], "email": r[4]}) for r in db.c)
@style.queue