jenkins-bot has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/467975 )
Change subject: [IMPR] Remove noisy title_match function
......................................................................
[IMPR] Remove noisy title_match function
detached from I4ef9009c9
Change-Id: I6d1e2315cace973099cbc4909b7504d4d162d18d
---
M scripts/patrol.py
1 file changed, 2 insertions(+), 13 deletions(-)
Approvals:
Dalba: Looks good to me, approved
jenkins-bot: Verified
diff --git a/scripts/patrol.py b/scripts/patrol.py
index 902133d..4e84499 100755
--- a/scripts/patrol.py
+++ b/scripts/patrol.py
@@ -192,7 +192,7 @@
if item.match(title):
return True
- elif title_match(item, title):
+ elif title.startswith(item):
return True
verbose_output('not found')
return False
@@ -361,17 +361,6 @@
.format(title(as_link=True)))
-def title_match(prefix, title):
- """Match title substring with given prefix."""
- if pywikibot.config.verbose_output:
- pywikibot.output('Matching {0} to prefix {1}'.format(title, prefix))
- if title.startswith(prefix):
- if pywikibot.config.verbose_output:
- pywikibot.output('substr match')
- return True
- return
-
-
class LinkedPagesRule(object):
"""Matches of page site title and linked pages
title."""
@@ -414,7 +403,7 @@
for p in self.linkedpages:
if pywikibot.config.verbose_output:
pywikibot.output("Checking against '{0}'".format(p))
- if title_match(p, page_title):
+ if page_title.startswith(p):
if pywikibot.config.verbose_output:
pywikibot.output('Matched.')
return p
--
To view, visit
https://gerrit.wikimedia.org/r/467975
To unsubscribe, or for help writing mail filters, visit
https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I6d1e2315cace973099cbc4909b7504d4d162d18d
Gerrit-Change-Number: 467975
Gerrit-PatchSet: 3
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Dalba <dalba.wiki(a)gmail.com>
Gerrit-Reviewer: Framawiki <framawiki(a)tools.wmflabs.org>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot (75)