summaryrefslogtreecommitdiffstats
path: root/pyload/database/File.py
diff options
context:
space:
mode:
Diffstat (limited to 'pyload/database/File.py')
-rw-r--r--pyload/database/File.py38
1 files changed, 19 insertions, 19 deletions
diff --git a/pyload/database/File.py b/pyload/database/File.py
index 205cbba1a..faf68b246 100644
--- a/pyload/database/File.py
+++ b/pyload/database/File.py
@@ -91,8 +91,8 @@ class FileHandler(object):
packs[x.id].update(x.toDict()[x.id])
for key, value in data.iteritems():
- if value["package"] in packs:
- packs[value["package"]]["links"][key] = value
+ if value['package'] in packs:
+ packs[value['package']]['links'][key] = value
return packs
@@ -277,11 +277,11 @@ class FileHandler(object):
cache = self.cache.values()
for x in cache:
- if int(x.toDbDict()[x.id]["package"]) == int(id):
+ if int(x.toDbDict()[x.id]['package']) == int(id):
tmplist.append((x.id, x.toDbDict()[x.id]))
data.update(tmplist)
- pack["links"] = data
+ pack['links'] = data
return pack
@@ -364,7 +364,7 @@ class FileHandler(object):
if jobs:
return self.getFile(jobs[0])
else:
- self.jobCache["decrypt"] = "empty"
+ self.jobCache['decrypt'] = "empty"
return None
@@ -516,20 +516,20 @@ class FileHandler(object):
f = self.getFileData(id)
f = f[id]
- e = RemoveEvent("file", id, "collector" if not self.getPackage(f["package"]).queue else "queue")
+ e = RemoveEvent("file", id, "collector" if not self.getPackage(f['package']).queue else "queue")
self.core.pullManager.addEvent(e)
self.db.reorderLink(f, position)
pyfiles = self.cache.values()
for pyfile in pyfiles:
- if pyfile.packageid != f["package"] or pyfile.order < 0: continue
- if f["order"] > position:
- if pyfile.order >= position and pyfile.order < f["order"]:
+ 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
pyfile.notifyChange()
- elif f["order"] < position:
- if pyfile.order <= position and pyfile.order > f["order"]:
+ elif f['order'] < position:
+ if pyfile.order <= position and pyfile.order > f['order']:
pyfile.order -= 1
pyfile.notifyChange()
@@ -538,7 +538,7 @@ class FileHandler(object):
self.db.commit()
- e = InsertEvent("file", id, position, "collector" if not self.getPackage(f["package"]).queue else "queue")
+ e = InsertEvent("file", id, position, "collector" if not self.getPackage(f['package']).queue else "queue")
self.core.pullManager.addEvent(e)
@@ -568,8 +568,8 @@ class FileHandler(object):
urls = []
for pyfile in data.itervalues():
- if pyfile["status"] not in (0, 12, 13):
- urls.append((pyfile["url"], pyfile["plugin"]))
+ if pyfile['status'] not in (0, 12, 13):
+ urls.append((pyfile['url'], pyfile['plugin']))
self.core.threadManager.createInfoThread(urls, pid)
@@ -842,12 +842,12 @@ class FileMethods(object):
@style.queue
def reorderLink(self, f, position):
""" reorder link with f as dict for pyfile """
- if f["order"] > position:
- self.c.execute('UPDATE links SET linkorder=linkorder+1 WHERE linkorder >= ? AND linkorder < ? AND package=?', (position, f["order"], f["package"]))
- elif f["order"] < position:
- self.c.execute('UPDATE links SET linkorder=linkorder-1 WHERE linkorder <= ? AND linkorder > ? AND package=?', (position, f["order"], f["package"]))
+ if f['order'] > position:
+ self.c.execute('UPDATE links SET linkorder=linkorder+1 WHERE linkorder >= ? AND linkorder < ? AND package=?', (position, f['order'], f['package']))
+ elif f['order'] < position:
+ self.c.execute('UPDATE links SET linkorder=linkorder-1 WHERE linkorder <= ? AND linkorder > ? AND package=?', (position, f['order'], f['package']))
- self.c.execute('UPDATE links SET linkorder=? WHERE id=?', (position, f["id"]))
+ self.c.execute('UPDATE links SET linkorder=? WHERE id=?', (position, f['id']))
@style.queue