jenkins-bot has submitted this change and it was merged. Change subject: category.py: consider also files, not only pages ......................................................................
category.py: consider also files, not only pages In CategoryTidyRobot(), a category is considered empty only if no pages are present, while number of files is not considered. This patch fixes it. Change-Id: I1a340e2337d44caeedd435a40160736ea943d7cb --- M scripts/category.py 1 file changed, 10 insertions(+), 8 deletions(-) Approvals: XZise: Looks good to me, but someone else must approve Ladsgroup: Looks good to me, approved jenkins-bot: Verified diff --git a/scripts/category.py b/scripts/category.py index fa7a3ea..cf07768 100755 --- a/scripts/category.py +++ b/scripts/category.py @@ -887,15 +887,17 @@ def run(self): cat = pywikibot.Category(self.site, self.catTitle) - if cat.categoryinfo['pages'] == 0: - pywikibot.output(u'There are no articles in category %s' + empty = True + preloadingGen = pagegenerators.PreloadingGenerator(cat.articles()) + for article in preloadingGen: + empty = False + pywikibot.output('') + pywikibot.output(u'=' * 67) + self.move_to_category(article, cat, cat) + + if empty: + pywikibot.output(u'There are no articles or files in category %s' % self.catTitle) - else: - preloadingGen = pagegenerators.PreloadingGenerator(cat.articles()) - for article in preloadingGen: - pywikibot.output('') - pywikibot.output(u'=' * 67) - self.move_to_category(article, cat, cat) class CategoryTreeRobot: -- To view, visit https://gerrit.wikimedia.org/r/157292 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1a340e2337d44caeedd435a40160736ea943d7cb Gerrit-PatchSet: 2 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: Mpaa <mpaa.w...@gmail.com> Gerrit-Reviewer: Ladsgroup <ladsgr...@gmail.com> Gerrit-Reviewer: Merlijn van Deen <valhall...@arctus.nl> Gerrit-Reviewer: XZise <commodorefabia...@gmx.de> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits