jenkins-bot has submitted this change and it was merged.
Change subject: Add superclass initialisation for three Bot scripts
......................................................................
Add superclass initialisation for three Bot scripts
Three scripts didnt call their superclass Bot's __init__.
Logic was recently added to the Bot class which depended on
the object being initialised properly.
Added a plain super call to replace.py and solve_disambiguation.py
and revise states_redirect.py soas it uses the new Bot 'site'
property manager.
Bug: 73494
Change-Id: I8dc7f2c4e45b020376060c0806acd02e987bf04a
---
M scripts/replace.py
M scripts/solve_disambiguation.py
M scripts/states_redirect.py
3 files changed, 7 insertions(+), 3 deletions(-)
Approvals:
XZise: Looks good to me, approved
jenkins-bot: Verified
diff --git a/scripts/replace.py b/scripts/replace.py
index c40ca69..4a79ddc 100755
--- a/scripts/replace.py
+++ b/scripts/replace.py
@@ -280,6 +280,7 @@
exceptionRegexes dictionary in textlib.replaceExcept().
"""
+ super(ReplaceRobot, self).__init__()
self.generator = generator
self.replacements = replacements
self.exceptions = exceptions
diff --git a/scripts/solve_disambiguation.py b/scripts/solve_disambiguation.py
index e29b618..9f26db8 100644
--- a/scripts/solve_disambiguation.py
+++ b/scripts/solve_disambiguation.py
@@ -470,6 +470,7 @@
def __init__(self, always, alternatives, getAlternatives, dnSkip,
generator,
primary, main_only, minimum=0):
+ super(DisambiguationRobot, self).__init__()
self.always = always
self.alternatives = alternatives
self.getAlternatives = getAlternatives
diff --git a/scripts/states_redirect.py b/scripts/states_redirect.py
index 6f3bbd1..1bf5d5c 100644
--- a/scripts/states_redirect.py
+++ b/scripts/states_redirect.py
@@ -57,16 +57,18 @@
@param force: Don't ask whether to create pages, just create
them.
"""
- self.start = start
+ site = pywikibot.Site()
+ generator = site.allpages(start=start)
+ super(StatesRedirectBot, self).__init__(generator=generator)
+
self.force = force
- self.site = pywikibot.Site()
+
# Created abbrev from pycountry data base
self.abbrev = {}
for subd in pycountry.subdivisions:
# Used subd.code[3:] to extract the exact code for
# subdivisional states(ignoring the country code).
self.abbrev[subd.name] = subd.code[3:]
- self.generator = self.site.allpages(start=self.start)
def treat(self, page):
""" Re-directing process.
--
To view, visit https://gerrit.wikimedia.org/r/173674
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I8dc7f2c4e45b020376060c0806acd02e987bf04a
Gerrit-PatchSet: 3
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <[email protected]>
Gerrit-Reviewer: Ladsgroup <[email protected]>
Gerrit-Reviewer: Merlijn van Deen <[email protected]>
Gerrit-Reviewer: XZise <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
Pywikibot-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikibot-commits