Revision: 4878 Author: btongminh Date: 2008-01-13 20:38:31 +0000 (Sun, 13 Jan 2008)
Log Message: ----------- Handle user blocks
Modified Paths: -------------- trunk/pywikipedia/commonsdelinker/delinker.py
Modified: trunk/pywikipedia/commonsdelinker/delinker.py =================================================================== --- trunk/pywikipedia/commonsdelinker/delinker.py 2008-01-13 20:37:07 UTC (rev 4877) +++ trunk/pywikipedia/commonsdelinker/delinker.py 2008-01-13 20:38:31 UTC (rev 4878) @@ -129,6 +129,8 @@ try: try: result = self.replace_image(image, site, title, summary, replacement) + except wikipedia.UserBlocked, e: + output(u'Warning! Blocked on %s by %s.' % (e[0], e[1])) except wikipedia.CaptchaError, e: output(u'%s Warning! Captcha encountered at %s.' % (self, site)) if (lang, family) not in skipped_images: @@ -153,6 +155,7 @@
if skipped_images: time.sleep(self.CommonsDelinker.config['timeout']) + output(u'Delinking from previously skipped page for %s.' % image) return self.delink_image(image, skipped_images, timestamp, admin, reason, replacement) elif replacement: # Let them know that we are done replacing.