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

Change subject: [BUGFIX] Template replace fixed in category.py 
CategoryMoveRobot.
......................................................................


[BUGFIX] Template replace fixed in category.py CategoryMoveRobot.

Fixes the the selection of category for deletion templates.
Now it uses pywikibot.translate()

Change-Id: I3a84e5488b2be090c821c70b4ab0288d853ac437
---
M scripts/category.py
1 file changed, 5 insertions(+), 2 deletions(-)

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



diff --git a/scripts/category.py b/scripts/category.py
index 15ddb78..05ee501 100755
--- a/scripts/category.py
+++ b/scripts/category.py
@@ -118,7 +118,9 @@
         'fi': [u'roskaa', u'poistettava', u'korjattava/nimi',
                u'yhdistettäväLuokka'],
         'he': [u'הצבעת מחיקה', u'למחוק'],
-        'nl': [u'categorieweg', u'catweg', u'wegcat', u'weg2']
+        'nl': [u'categorieweg', u'catweg', u'wegcat', u'weg2'],
+        # For testing purposes
+        'test': [u'delete']
     },
     'commons': {
         'commons': [u'cfd', u'move']
@@ -520,7 +522,8 @@
         match = re.compile(REGEX,
                            re.IGNORECASE | re.MULTILINE | re.DOTALL)
         self.newcat.text = match.sub('', self.newcat.text)
-        for template_name in cfd_templates:
+        site_templates = pywikibot.translate(self.site, cfd_templates, 
fallback=False)
+        for template_name in site_templates:
             match = re.compile(r"{{%s.*?}}" % template_name, re.IGNORECASE)
             self.newcat.text = match.sub('', self.newcat.text)
         # Remove leading whitespace

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

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

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

Reply via email to