diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-01-23 15:51:19 +0100 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-01-23 15:51:19 +0100 |
commit | 9aa8ca3b24133bef767f0eb8508e276fa7f92ee9 (patch) | |
tree | ecaeeafaa00e71f10d5df5ba9fc54a721e7d5e35 /module/file_list.py | |
parent | file_list save fix (diff) | |
download | pyload-9aa8ca3b24133bef767f0eb8508e276fa7f92ee9.tar.xz |
added missing icons, final improvments
Diffstat (limited to 'module/file_list.py')
-rw-r--r-- | module/file_list.py | 19 |
1 files changed, 7 insertions, 12 deletions
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): |