diff options
author | Vuolter <vuolter@gmail.com> | 2013-05-15 20:57:04 +0200 |
---|---|---|
committer | Walter Purcaro <vuolter@gmail.com> | 2013-05-25 09:29:32 +0200 |
commit | d30434b88b3d13aef1ba8cf0f29385229c82c9ed (patch) | |
tree | 5ecb24aec6a79c2b83a5e59567f11c613bdc320d /module/plugins/hooks | |
parent | Version 0.02: log actions (diff) | |
download | pyload-d30434b88b3d13aef1ba8cf0f29385229c82c9ed.tar.xz |
Version 0.3: use endswith instead of find (thx stickell)
Diffstat (limited to 'module/plugins/hooks')
-rw-r--r-- | module/plugins/hooks/SkipRev.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/module/plugins/hooks/SkipRev.py b/module/plugins/hooks/SkipRev.py index 0ac8de412..ce57fe4b5 100644 --- a/module/plugins/hooks/SkipRev.py +++ b/module/plugins/hooks/SkipRev.py @@ -22,7 +22,7 @@ from module.plugins.Hook import Hook class SkipRev(Hook): __name__ = "SkipRev" - __version__ = "0.02" + __version__ = "0.03" __description__ = "Skip download when filename has rev extension" __config__ = [ ("activated", "bool", "Activated", "False"), @@ -34,10 +34,10 @@ class SkipRev(Hook): def downloadPreparing(self, pyfile): # self.logDebug("self.downloadPreparing") name = basename(pyfile.name) - number = self.getConfig("number") - if name.find(".rev") != -1: - for i in range(1, number): - if name.find(i + ".rev") != -1: + max = self.getConfig("number") + if name.endswith(".rev"): + for n in range(1, max): + if name.endswith(n + ".rev"): return self.logInfo("Skipping " + name) pyfile.setStatus("skipped") |