From 9aa8ca3b24133bef767f0eb8508e276fa7f92ee9 Mon Sep 17 00:00:00 2001 From: RaNaN Date: Sat, 23 Jan 2010 15:51:19 +0100 Subject: added missing icons, final improvments --- module/file_list.py | 19 +++++++------------ module/web/media/default/img/accept.png | Bin 781 -> 0 bytes module/web/media/default/img/clock_play.png | Bin 943 -> 0 bytes module/web/media/default/img/clock_red.png | Bin 889 -> 0 bytes module/web/media/default/img/status_None.png | Bin 0 -> 7613 bytes module/web/media/default/img/status_aborted.png | Bin 0 -> 700 bytes module/web/media/default/img/status_downloading.png | Bin 0 -> 943 bytes module/web/media/default/img/status_failed.png | Bin 0 -> 700 bytes module/web/media/default/img/status_finished.png | Bin 0 -> 781 bytes module/web/media/default/img/status_waiting.png | Bin 0 -> 889 bytes module/web/media/default/img/stop.png | Bin 700 -> 0 bytes module/web/media/img/favicon.ico | Bin 0 -> 7206 bytes module/web/pyload/views.py | 5 +---- 13 files changed, 8 insertions(+), 16 deletions(-) delete mode 100644 module/web/media/default/img/accept.png delete mode 100644 module/web/media/default/img/clock_play.png delete mode 100644 module/web/media/default/img/clock_red.png create mode 100644 module/web/media/default/img/status_None.png create mode 100644 module/web/media/default/img/status_aborted.png create mode 100644 module/web/media/default/img/status_downloading.png create mode 100644 module/web/media/default/img/status_failed.png create mode 100644 module/web/media/default/img/status_finished.png create mode 100644 module/web/media/default/img/status_waiting.png delete mode 100644 module/web/media/default/img/stop.png create mode 100644 module/web/media/img/favicon.ico (limited to 'module') diff --git a/module/file_list.py b/module/file_list.py index 4e69bfdef..1c4c4776b 100644 --- a/module/file_list.py +++ b/module/file_list.py @@ -29,6 +29,7 @@ import cPickle import re import module.Plugin from operator import concat +from operator import attrgetter from os import sep from time import sleep @@ -150,10 +151,7 @@ class File_List(object): return info def continueAborted(self): - for pypack in self.data["queue"]: - for pyfile in pypack.files: - if pyfile.status.type == "aborted": - self.packager.resetFileStatus(pyfile.id) + [[self.packager.resetFileStatus(x.id) for x in p.files if x.status.type == "aborted"] for p in self.data["queue"]] class pyLoadCollector(): def __init__(collector, file_list): @@ -176,8 +174,7 @@ class File_List(object): for pypack in (collector.file_list.data["packages"] + collector.file_list.data["queue"]): for pyf in pypack.files: ids.append(pyf.id) - for pyfile in collector.file_list.data["collector"]: - ids.append(pyfile.id) + ids += map(attrgetter("id"), collector.file_list.data["collector"]) id = 1 while id in ids: id += 1 @@ -241,9 +238,8 @@ class File_List(object): """ returns a free id """ - ids = [] - for pypack in (packager.file_list.data["packages"] + packager.file_list.data["queue"]): - ids.append(pypack.data["id"]) + ids = [ pypack.data["id"] for pypack in packager.file_list.data["packages"] + packager.file_list.data["queue"]] + id = 1 while id in ids: id += 1 @@ -347,9 +343,8 @@ class File_List(object): def getPackageFiles(packager, id): key, n, pypack = packager._getPackageFromID(id) - ids = [] - for pyfile in pypack.files: - ids.append(pyfile.id) + ids = map(attrgetter("id"), pypack.files) + return ids def addFileToPackage(packager, id, pyfile): diff --git a/module/web/media/default/img/accept.png b/module/web/media/default/img/accept.png deleted file mode 100644 index 89c8129a4..000000000 Binary files a/module/web/media/default/img/accept.png and /dev/null differ diff --git a/module/web/media/default/img/clock_play.png b/module/web/media/default/img/clock_play.png deleted file mode 100644 index fb4ebc850..000000000 Binary files a/module/web/media/default/img/clock_play.png and /dev/null differ diff --git a/module/web/media/default/img/clock_red.png b/module/web/media/default/img/clock_red.png deleted file mode 100644 index 2842cc338..000000000 Binary files a/module/web/media/default/img/clock_red.png and /dev/null differ diff --git a/module/web/media/default/img/status_None.png b/module/web/media/default/img/status_None.png new file mode 100644 index 000000000..293b13f77 Binary files /dev/null and b/module/web/media/default/img/status_None.png differ diff --git a/module/web/media/default/img/status_aborted.png b/module/web/media/default/img/status_aborted.png new file mode 100644 index 000000000..0cfd58596 Binary files /dev/null and b/module/web/media/default/img/status_aborted.png differ diff --git a/module/web/media/default/img/status_downloading.png b/module/web/media/default/img/status_downloading.png new file mode 100644 index 000000000..fb4ebc850 Binary files /dev/null and b/module/web/media/default/img/status_downloading.png differ diff --git a/module/web/media/default/img/status_failed.png b/module/web/media/default/img/status_failed.png new file mode 100644 index 000000000..0cfd58596 Binary files /dev/null and b/module/web/media/default/img/status_failed.png differ diff --git a/module/web/media/default/img/status_finished.png b/module/web/media/default/img/status_finished.png new file mode 100644 index 000000000..89c8129a4 Binary files /dev/null and b/module/web/media/default/img/status_finished.png differ diff --git a/module/web/media/default/img/status_waiting.png b/module/web/media/default/img/status_waiting.png new file mode 100644 index 000000000..2842cc338 Binary files /dev/null and b/module/web/media/default/img/status_waiting.png differ diff --git a/module/web/media/default/img/stop.png b/module/web/media/default/img/stop.png deleted file mode 100644 index 0cfd58596..000000000 Binary files a/module/web/media/default/img/stop.png and /dev/null differ diff --git a/module/web/media/img/favicon.ico b/module/web/media/img/favicon.ico new file mode 100644 index 000000000..58b1f4b89 Binary files /dev/null and b/module/web/media/img/favicon.ico differ diff --git a/module/web/pyload/views.py b/module/web/pyload/views.py index d72dca56c..ea9d5f1be 100644 --- a/module/web/pyload/views.py +++ b/module/web/pyload/views.py @@ -75,10 +75,7 @@ def home(request): def queue(request): queue = settings.PYLOAD.get_queue() for pack in queue: - children = [] - for child in settings.PYLOAD.get_package_files(pack["id"]): - children.append(settings.PYLOAD.get_file_info(child)) - pack["children"] = children + pack["children"] = map(settings.PYLOAD.get_file_info, settings.PYLOAD.get_package_files(pack["id"])) return render_to_response(join(settings.TEMPLATE, 'queue.html'), RequestContext(request, {'content': queue}, [status_proc])) -- cgit v1.2.3