jenkins-bot has submitted this change and it was merged.

Change subject: Fix normalization of template name in harvest_template
......................................................................


Fix normalization of template name in harvest_template

bug: 55122
Change-Id: Ie5969c5ac07c0a0f2b8a104f16513e24f0aa796a
---
M scripts/harvest_template.py
1 file changed, 4 insertions(+), 1 deletion(-)

Approvals:
  Xqt: Looks good to me, but someone else must approve
  Merlijn van Deen: Looks good to me, approved
  Multichill: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/scripts/harvest_template.py b/scripts/harvest_template.py
index 89b034a..9cf59a1 100755
--- a/scripts/harvest_template.py
+++ b/scripts/harvest_template.py
@@ -107,8 +107,11 @@
             pagetext = page.get()
             templates = pywikibot.extract_templates_and_params(pagetext)
             for (template, fielddict) in templates:
+                # Clean up template
+                template = pywikibot.Page(page.site, template,
+                                          ns=10).title(withNamespace=False)
                 # We found the template we were looking for
-                if template.replace(u'_', u' ') in self.templateTitles:
+                if template in self.templateTitles:
                     for field, value in fielddict.items():
                         field = field.strip()
                         value = value.strip()

-- 
To view, visit https://gerrit.wikimedia.org/r/89046
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie5969c5ac07c0a0f2b8a104f16513e24f0aa796a
Gerrit-PatchSet: 2
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Multichill <[email protected]>
Gerrit-Reviewer: Ladsgroup <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: Merlijn van Deen <[email protected]>
Gerrit-Reviewer: Multichill <[email protected]>
Gerrit-Reviewer: Xqt <[email protected]>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to