jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/524305 )

Change subject: archivebot.py: don't reorder template parameters
......................................................................

archivebot.py: don't reorder template parameters

Page.raw_extracted_templates is based on an ordered dict, which preserves
order of parameters.
As opposite of Page.templatesWithParams(), which uses plain dictionaries.

Bug: T220828
Change-Id: I0ac00fe1a6251833c8ae3ae94bea8f59f46d9a59
---
M scripts/archivebot.py
1 file changed, 3 insertions(+), 4 deletions(-)

Approvals:
  Xqt: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/scripts/archivebot.py b/scripts/archivebot.py
index 5ea63ac..97c0bb9 100755
--- a/scripts/archivebot.py
+++ b/scripts/archivebot.py
@@ -571,10 +571,9 @@
         """Load and validate archiver template."""
         pywikibot.output('Looking for: {{%s}} in %s' % (self.tpl.title(),
                                                         self.page))
-        for tpl in self.page.templatesWithParams():
-            if tpl[0] == pywikibot.Page(self.site, self.tpl.title(), ns=10):
-                for param in tpl[1]:
-                    item, value = param.split('=', 1)
+        for tpl in self.page.raw_extracted_templates:
+            if tpl[0] == self.tpl.title():
+                for item, value in tpl[1].items():
                     self.set_attr(item.strip(), value.strip())
                 break
         else:

--
To view, visit https://gerrit.wikimedia.org/r/524305
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: I0ac00fe1a6251833c8ae3ae94bea8f59f46d9a59
Gerrit-Change-Number: 524305
Gerrit-PatchSet: 2
Gerrit-Owner: Mpaa <[email protected]>
Gerrit-Reviewer: D3r1ck01 <[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