jenkins-bot has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/408069 )
Change subject: [bugfix] templatesWithParams() gives a Page object with first tuple item
......................................................................
[bugfix] templatesWithParams() gives a Page object with first tuple item
Bug: T186459
Change-Id: I9ff7f13403d63982b1e39d8539a25f5498129e2e
---
M scripts/imagecopy_self.py
1 file changed, 3 insertions(+), 4 deletions(-)
Approvals:
Dalba: Looks good to me, approved
jenkins-bot: Verified
diff --git a/scripts/imagecopy_self.py b/scripts/imagecopy_self.py
index dcbc8f1..6ed5e7f 100644
--- a/scripts/imagecopy_self.py
+++ b/scripts/imagecopy_self.py
@@ -438,15 +438,14 @@
for key, value in informationFields[imagepage.site.lang].items():
contents[value] = u''
- templates = imagepage.templatesWithParams()
information = informationTemplate[imagepage.site.lang]
fields = informationFields[imagepage.site.lang]
- for (template, params) in templates:
- if template == information:
+ for template, params in imagepage.templatesWithParams():
+ if template.title() == information:
for param in params:
# Split at =
- (field, sep, value) = param.partition(u'=')
+ field, sep, value = param.partition('=')
# To lowercase, remove underscores and strip of spaces
field = field.lower().replace(u'_', u' ').strip()
key = fields.get(field)
--
To view, visit
https://gerrit.wikimedia.org/r/408069
To unsubscribe, visit
https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I9ff7f13403d63982b1e39d8539a25f5498129e2e
Gerrit-Change-Number: 408069
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Dalba <dalba.wiki(a)gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Multichill <maarten(a)mdammers.nl>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: Zoranzoki21 <zorandori4444(a)gmail.com>
Gerrit-Reviewer: jenkins-bot <>