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 <pyfisch(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot <>