summaryrefslogtreecommitdiffstats
path: root/pyload/database/File.py
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-04-18 00:29:55 +0200
committerGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-04-18 00:29:55 +0200
commitbb5a115533711fd8bb87f53cb32ff7342137208d (patch)
tree476600f9896fae029880e4049eb4c5e6021b202d /pyload/database/File.py
parentPEP-8, Python Zen, refactor and reduce code (part 6 in master module/common) (diff)
downloadpyload-bb5a115533711fd8bb87f53cb32ff7342137208d.tar.xz
Spare code cosmetics (5)
Diffstat (limited to 'pyload/database/File.py')
-rw-r--r--pyload/database/File.py18
1 files changed, 12 insertions, 6 deletions
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)