jenkins-bot has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/440547 )
Change subject: Remove an unused attribute from HarvestRobot
......................................................................
Remove an unused attribute from HarvestRobot
The attribute is only used to make a list of templates.
Change-Id: Id247b3359b51f493a59738e1d5f01523c11786e8
---
M scripts/harvest_template.py
M tox.ini
2 files changed, 6 insertions(+), 6 deletions(-)
Approvals:
Mpaa: Looks good to me, approved
jenkins-bot: Verified
diff --git a/scripts/harvest_template.py b/scripts/harvest_template.py
index 2db474e..5bb82bc 100755
--- a/scripts/harvest_template.py
+++ b/scripts/harvest_template.py
@@ -123,14 +123,14 @@
"""A bot to add Wikidata claims."""
- def __init__(self, generator, templateTitle, fields, **kwargs):
+ def __init__(self, generator, template_title, fields, **kwargs):
"""
Initializer.
@param generator: A generator that yields Page objects
@type generator: iterator
- @param templateTitle: The template to work on
- @type templateTitle: str
+ @param template_title: The template to work on
+ @type template_title: str
@param fields: A dictionary of fields that are of use to us
@type fields: dict
@keyword islink: Whether non-linked values should be treated as links
@@ -149,7 +149,6 @@
})
super(HarvestRobot, self).__init__(**kwargs)
self.generator = generator
- self.templateTitle = templateTitle.replace(u'_', u' ')
# TODO: Make it a list which also includes the redirects to the template
self.fields = {}
for key, value in fields.items():
@@ -158,7 +157,8 @@
else: # backwards compatibility
self.fields[key] = (value, PropertyOptionHandler())
self.cacheSources()
- self.templateTitles = self.getTemplateSynonyms(self.templateTitle)
+ template_title = template_title.replace('_', ' ')
+ self.templateTitles = self.getTemplateSynonyms(template_title)
self.linkR = textlib.compileLinkR()
self.create_missing_item = self.getOption('create')
diff --git a/tox.ini b/tox.ini
index bef79b1..df5d598 100644
--- a/tox.ini
+++ b/tox.ini
@@ -209,7 +209,7 @@
scripts/data_ingestion.py : N803, N806
scripts/fixing_redirects.py : N803, N806
scripts/flickrripper.py : T001, N803, N806
- scripts/harvest_template.py : T001, N803
+ scripts/harvest_template.py : T001
scripts/imagecopy.py : N801, N803, N806
scripts/imagecopy_self.py : N801, N803, N806
scripts/imagerecat.py : N803, N806
--
To view, visit
https://gerrit.wikimedia.org/r/440547
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: Id247b3359b51f493a59738e1d5f01523c11786e8
Gerrit-Change-Number: 440547
Gerrit-PatchSet: 3
Gerrit-Owner: Matěj Suchánek <matejsuchanek97(a)gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Mpaa <mpaa.wiki(a)gmail.com>
Gerrit-Reviewer: Zoranzoki21 <zorandori4444(a)gmail.com>
Gerrit-Reviewer: jenkins-bot