jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/369670 )
Change subject: [Cleanup] Remove PatrolRule class ......................................................................
[Cleanup] Remove PatrolRule class
PatrolRule is a superclass for LinkedPagesRule but never used anywhere in the script (or other framework scripts). The title() method is the only one difference (maybe this method isn't used). Merge the base class to the child class.
Change-Id: I8e331857d9b7e3f51d5fef431d8ff586c6d7ecfc --- M scripts/patrol.py 1 file changed, 6 insertions(+), 24 deletions(-)
Approvals: Mpaa: Looks good to me, approved jenkins-bot: Verified
diff --git a/scripts/patrol.py b/scripts/patrol.py index 8396467..14c24a7 100755 --- a/scripts/patrol.py +++ b/scripts/patrol.py @@ -185,7 +185,7 @@ if pywikibot.config.verbose_output: pywikibot.output(u'checking against whitelist item = %s' % item)
- if isinstance(item, PatrolRule): + if isinstance(item, LinkedPagesRule): if pywikibot.config.verbose_output: pywikibot.output(u'invoking programmed rule') if item.match(title): @@ -377,29 +377,7 @@ return
-class PatrolRule(object): - - """Bot marks the edit.startswith("-s as patrolled based on info obtained by whitelist.""" - - def __init__(self, page_title): - """ - Constructor. - - @param page_title: The page title for this rule - @type page_title: pywikibot.Page - """ - self.page_title = page_title - - def title(self): - """Obtain page title.""" - return self.page_title - - def match(self, page): - """Added for future use.""" - pass - - -class LinkedPagesRule(PatrolRule): +class LinkedPagesRule(object):
"""Matches of page site title and linked pages title."""
@@ -413,6 +391,10 @@ self.page_title = page_title self.linkedpages = None
+ def title(self): + """Obtain page title.""" + return self.page_title + def match(self, page_title): """Match page_title to linkedpages elements.""" if page_title == self.page_title:
pywikibot-commits@lists.wikimedia.org