jenkins-bot has submitted this change and it was merged. Change subject: [FIX] category: Use Category instance for title ......................................................................
[FIX] category: Use Category instance for title With acf2280a83c1518982d14add67d6b6e51e4fa69c nocapitalize was deprecated and replaced by checking the namespace's setting. By doing that category accidentally didn't check in the site but just using 'self' similar to T91234. This now uses the functionality of Category (which uses Link for that). Change-Id: I049a0e6e8739161ee054cb34e4f5c58f6116bd89 --- M scripts/category.py 1 file changed, 2 insertions(+), 5 deletions(-) Approvals: John Vandenberg: Looks good to me, approved jenkins-bot: Verified diff --git a/scripts/category.py b/scripts/category.py index 1db584f..51bb82a 100755 --- a/scripts/category.py +++ b/scripts/category.py @@ -350,10 +350,7 @@ pywikibot.output(u"Current categories:") for cat in cats: pywikibot.output(u"* %s" % cat.title()) - newcat = self.newcat - if self.namespaces[14].case == 'first-letter': - newcat = newcat[:1].upper() + newcat[1:] - catpl = pywikibot.Category(self.current_page.site, newcat) + catpl = pywikibot.Category(self.current_page.site, self.newcat) if catpl in cats: pywikibot.output(u"%s is already in %s." % (self.current_page.title(), catpl.title())) @@ -368,7 +365,7 @@ if not comment: comment = i18n.twtranslate(self.current_page.site, 'category-adding', - {'newcat': newcat}) + {'newcat': catpl.title(withNamespace=False)}) try: self.userPut(self.current_page, old_text, text, comment=comment, minor=True, botflag=True) -- To view, visit https://gerrit.wikimedia.org/r/194396 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I049a0e6e8739161ee054cb34e4f5c58f6116bd89 Gerrit-PatchSet: 3 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: XZise <commodorefabia...@gmx.de> Gerrit-Reviewer: John Vandenberg <jay...@gmail.com> Gerrit-Reviewer: Ladsgroup <ladsgr...@gmail.com> Gerrit-Reviewer: Merlijn van Deen <valhall...@arctus.nl> Gerrit-Reviewer: Ricordisamoa <ricordisa...@openmailbox.org> Gerrit-Reviewer: XZise <commodorefabia...@gmx.de> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ Pywikibot-commits mailing list Pywikibot-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/pywikibot-commits