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 <[email protected]>
Gerrit-Reviewer: Dalba <[email protected]>
Gerrit-Reviewer: Framawiki <[email protected]>
Gerrit-Reviewer: John Vandenberg <[email protected]>
Gerrit-Reviewer: Xqt <[email protected]>
Gerrit-Reviewer: jenkins-bot (75)
_______________________________________________
Pywikibot-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikibot-commits

Reply via email to