Revision: 4490 Author: btongminh Date: 2007-10-31 21:02:08 +0000 (Wed, 31 Oct 2007)
Log Message: ----------- Retry on Captcha
Modified Paths: -------------- trunk/pywikipedia/commonsdelinker/delinker.py
Modified: trunk/pywikipedia/commonsdelinker/delinker.py =================================================================== --- trunk/pywikipedia/commonsdelinker/delinker.py 2007-10-31 20:58:43 UTC (rev 4489) +++ trunk/pywikipedia/commonsdelinker/delinker.py 2007-10-31 21:02:08 UTC (rev 4490) @@ -127,7 +127,14 @@ output(u'%s Delinking %s from %s' % (self, image, site)) try: - result = self.replace_image(image, site, title, summary, replacement) + try: + result = self.replace_image(image, site, title, summary, replacement) + except wikipedia.CaptchaError, e: + output(u'%s Warning! Captcha encountered at %s.' % (self, site)) + if (lang, family) not in skipped_images: + skipped_images[(lang, family)] = [] + skipped_images[(lang, family)].append( + (page_namespace, page_title, title)) finally: self.CommonsDelinker.unset_edit(str(site), title)