Revision: 6398 Author: filnik Date: 2009-02-21 13:55:07 +0000 (Sat, 21 Feb 2009)
Log Message: ----------- Bugfix(?) for when the APIs are down..
Modified Paths: -------------- trunk/pywikipedia/checkimages.py
Modified: trunk/pywikipedia/checkimages.py =================================================================== --- trunk/pywikipedia/checkimages.py 2009-02-21 12:24:15 UTC (rev 6397) +++ trunk/pywikipedia/checkimages.py 2009-02-21 13:55:07 UTC (rev 6398) @@ -522,7 +522,7 @@ else: raise wikipedia.Error(data) if len(members) == int(cmlimit): - raise wikipedia.Error(u'The category selected as >= %s elements, limit reached.' % cmlimit) + raise wikipedia.Error(u'The category selected has >= %s elements, limit reached.' % cmlimit) allmembers = members results = list() for subcat in members: @@ -1157,6 +1157,8 @@ self.whiteTemplatesFound = False regex_find_licenses = re.compile(r'(?<!{){{(?:[Tt]emplate:|)([^{]+?)[|\n<}]', re.DOTALL) templatesInTheImageRaw = regex_find_licenses.findall(self.imageCheckText) + if self.licenses_found == [] and templatesInTheImageRaw != []: + raise wikipedia.Error("APIs seems down. No templates found with them but actually there are templates used in the image's page!") self.allLicenses = list() if self.list_licenses == []: raise wikipedia.Error(u'No licenses allowed provided, add that option to the code to make the script working correctly')