http://www.mediawiki.org/wiki/Special:Code/pywikipedia/9399
Revision: 9399 Author: multichill Date: 2011-07-16 16:17:24 +0000 (Sat, 16 Jul 2011) Log Message: ----------- Check if the added category actually exists.
Modified Paths: -------------- trunk/pywikipedia/imageuncat.py
Modified: trunk/pywikipedia/imageuncat.py =================================================================== --- trunk/pywikipedia/imageuncat.py 2011-07-16 16:17:18 UTC (rev 9398) +++ trunk/pywikipedia/imageuncat.py 2011-07-16 16:17:24 UTC (rev 9399) @@ -1294,9 +1294,12 @@ pywikibot.output(u'Working on '+ page.title())
for category in page.categories(): - if category.title() not in ignoreCategories: - pywikibot.output(u'Got category ' + category.title()) - return False + # 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
for templateWithTrail in page.templates():
pywikipedia-svn@lists.wikimedia.org