http://www.mediawiki.org/wiki/Special:Code/pywikipedia/9409
Revision: 9409 Author: multichill Date: 2011-07-16 23:05:34 +0000 (Sat, 16 Jul 2011) Log Message: ----------- Also skip hidden categories.
Modified Paths: -------------- trunk/pywikipedia/imageuncat.py
Modified: trunk/pywikipedia/imageuncat.py =================================================================== --- trunk/pywikipedia/imageuncat.py 2011-07-16 22:04:42 UTC (rev 9408) +++ trunk/pywikipedia/imageuncat.py 2011-07-16 23:05:34 UTC (rev 9409) @@ -1296,11 +1296,12 @@ for category in page.categories(): # Check if it's not a red link category if category.exists(): - # Check if it's not a category to ignore - if category.title() not in ignoreCategories: - pywikibot.output(u'Got category ' + category.title()) - return False - #FIXME: Add check if the category is hidden. If hidden -> ignore + # If the category is hidden -> ignore it, it's not a topic category + if not category.isHiddenCategory(): + # Check if it's not a category to ignore + if category.title() not in ignoreCategories: + pywikibot.output(u'Got category ' + category.title()) + return False
for templateWithTrail in page.templates(): #Strip of trailing garbage