From d30434b88b3d13aef1ba8cf0f29385229c82c9ed Mon Sep 17 00:00:00 2001 From: Vuolter Date: Wed, 15 May 2013 20:57:04 +0200 Subject: Version 0.3: use endswith instead of find (thx stickell) --- module/plugins/hooks/SkipRev.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'module/plugins/hooks') 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") -- cgit v1.2.3