summaryrefslogtreecommitdiffstats
path: root/pyload/database
diff options
context:
space:
mode:
Diffstat (limited to 'pyload/database')
-rw-r--r--pyload/database/Backend.py2
-rw-r--r--pyload/database/File.py18
-rw-r--r--pyload/database/User.py4
3 files changed, 15 insertions, 9 deletions
diff --git a/pyload/database/Backend.py b/pyload/database/Backend.py
index cfdee058e..b0e94711e 100644
--- a/pyload/database/Backend.py
+++ b/pyload/database/Backend.py
@@ -81,7 +81,7 @@ class DatabaseJob(object):
from os.path import basename
frame = self.frame.f_back
output = ""
- for i in range(5):
+ for _i in range(5):
output += "\t%s:%s, %s\n" % (basename(frame.f_code.co_filename), frame.f_lineno, frame.f_code.co_name)
frame = frame.f_back
del frame
diff --git a/pyload/database/File.py b/pyload/database/File.py
index faf68b246..7cbe1890a 100644
--- a/pyload/database/File.py
+++ b/pyload/database/File.py
@@ -87,7 +87,8 @@ class FileHandler(object):
data.update([(x.id, x.toDbDict()[x.id]) for x in self.cache.values()])
for x in self.packageCache.itervalues():
- if x.queue != queue or x.id not in packs: continue
+ if x.queue != queue or x.id not in packs:
+ continue
packs[x.id].update(x.toDict()[x.id])
for key, value in data.iteritems():
@@ -103,7 +104,8 @@ class FileHandler(object):
packs = self.db.getAllPackages(queue)
for x in self.packageCache.itervalues():
- if x.queue != queue or x.id not in packs: continue
+ if x.queue != queue or x.id not in packs:
+ continue
packs[x.id].update(x.toDict()[x.id])
return packs
@@ -493,7 +495,8 @@ class FileHandler(object):
packs = self.packageCache.values()
for pack in packs:
- if pack.queue != p.queue or pack.order < 0 or pack == p: continue
+ if pack.queue != p.queue or pack.order < 0 or pack == p:
+ continue
if p.order > position:
if pack.order >= position and pack.order < p.order:
pack.order += 1
@@ -523,7 +526,8 @@ class FileHandler(object):
pyfiles = self.cache.values()
for pyfile in pyfiles:
- if pyfile.packageid != f['package'] or pyfile.order < 0: continue
+ if pyfile.packageid != f['package'] or pyfile.order < 0:
+ continue
if f['order'] > position:
if pyfile.order >= position and pyfile.order < f['order']:
pyfile.order += 1
@@ -871,7 +875,8 @@ class FileMethods(object):
"""return package instance from id"""
self.c.execute("SELECT name, folder, site, password, queue, packageorder FROM packages WHERE id=?", (str(id),))
r = self.c.fetchone()
- if not r: return None
+ if not r:
+ return None
return PyPackage(self.manager, id, * r)
@@ -882,7 +887,8 @@ class FileMethods(object):
"""return link instance from id"""
self.c.execute("SELECT url, name, size, status, error, plugin, package, linkorder FROM links WHERE id=?", (str(id),))
r = self.c.fetchone()
- if not r: return None
+ if not r:
+ return None
r = list(r)
r[5] = tuple(r[5].split('.'))
return PyFile(self.manager, id, * r)
diff --git a/pyload/database/User.py b/pyload/database/User.py
index 374570fb7..e11961e32 100644
--- a/pyload/database/User.py
+++ b/pyload/database/User.py
@@ -30,7 +30,7 @@ class UserMethods(object):
@style.queue
def addUser(db, user, password):
- salt = reduce(lambda x, y: x + y, [str(random.randint(0, 9)) for i in range(0, 5)])
+ salt = reduce(lambda x, y: x + y, [str(random.randint(0, 9)) for _i in range(0, 5)])
h = sha1(salt + password)
password = salt + h.hexdigest()
@@ -53,7 +53,7 @@ class UserMethods(object):
pw = r[2][5:]
h = sha1(salt + oldpw)
if h.hexdigest() == pw:
- salt = reduce(lambda x, y: x + y, [str(random.randint(0, 9)) for i in range(0, 5)])
+ salt = reduce(lambda x, y: x + y, [str(random.randint(0, 9)) for _i in range(0, 5)])
h = sha1(salt + newpw)
password = salt + h.hexdigest()