diff options
author | Walter Purcaro <vuolter@gmail.com> | 2014-12-03 00:28:06 +0100 |
---|---|---|
committer | Walter Purcaro <vuolter@gmail.com> | 2014-12-03 00:28:06 +0100 |
commit | 69add4e0f3df7f078eafa022e9a59ac21cfaa19b (patch) | |
tree | a71002d4f061334a68061d0ab530b0b2d64d54f6 /module | |
parent | [UpdateManager] Fix https://github.com/pyload/pyload/issues/940 (2) (diff) | |
download | pyload-69add4e0f3df7f078eafa022e9a59ac21cfaa19b.tar.xz |
[SkipRev] Syntax fixes
Diffstat (limited to 'module')
-rw-r--r-- | module/plugins/hooks/SkipRev.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/module/plugins/hooks/SkipRev.py b/module/plugins/hooks/SkipRev.py index a64f1a83b..feed16a2b 100644 --- a/module/plugins/hooks/SkipRev.py +++ b/module/plugins/hooks/SkipRev.py @@ -9,7 +9,7 @@ from module.plugins.Plugin import SkipDownload class SkipRev(Hook): __name__ = "SkipRev" __type__ = "hook" - __version__ = "0.10" + __version__ = "0.11" __config__ = [("auto", "bool", "Automatically keep all rev files needed by package", True), ("tokeep", "int" , "Min number of rev files to keep for package" , 1), @@ -20,20 +20,20 @@ class SkipRev(Hook): __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] - event_map = [("downloadStarts", skipRev)] + event_list = ["downloadStarts"] REV = re.compile(r'\.part(\d+)\.rev$') - def skipRev(self, pyfile, url, filename): - if REV.search(pyfile.name) is None or pyfile.getStatusName() is "unskipped": + def downloadStarts(self, pyfile, url, filename): + if self.REV.search(pyfile.name) is None or pyfile.getStatusName() is "unskipped": return tokeep = self.getConfig("tokeep") if tokeep > 0: - saved = [True if link.hasStatus("finished") or link.hasStatus("downloading") and REV.search(link.name) \ - for link in pyfile.package().getChildren()].count(True) + saved = [True for link in pyfile.package().getChildren() \ + if link.hasStatus("finished") or link.hasStatus("downloading") and self.REV.search(link.name)].count(True) if saved < tokeep: return @@ -47,10 +47,10 @@ class SkipRev(Hook): if self.getConfig("unskip") is False: return - if REV.search(pyfile.name) is None: + if self.REV.search(pyfile.name) is None: return for link in pyfile.package().getChildren(): - if link.hasStatus("skipped") and REV.search(link.name): + if link.hasStatus("skipped") and self.REV.search(link.name): link.setCustomStatus("unskipped", "queued") return |