Revision: 3947 Author: wikipedian Date: 2007-08-02 01:15:39 +0000 (Thu, 02 Aug 2007)
Log Message: ----------- Fixed serious bug: The bot didn't report to talk pages anymore unless the URL was found in the Internet Archive. I wonder that nobody noticed.
Modified Paths: -------------- trunk/pywikipedia/weblinkchecker.py
Modified: trunk/pywikipedia/weblinkchecker.py =================================================================== --- trunk/pywikipedia/weblinkchecker.py 2007-08-02 00:48:21 UTC (rev 3946) +++ trunk/pywikipedia/weblinkchecker.py 2007-08-02 01:15:39 UTC (rev 3947) @@ -550,13 +550,13 @@ self.semaphore.acquire() (url, errorReport, containingPage, archiveURL) = self.queue[0] self.queue = self.queue[1:] - message = u'** Reporting dead link on ' + containingPage.toggleTalkPage().aslink() + '...' + talkPage = containingPage.toggleTalkPage() + message = u'** Reporting dead link on ' + talkPage.aslink() + '...' wikipedia.output(message, colors = [11] * len(message)) - talk = containingPage.toggleTalkPage() try: - content = talk.get() + "\n\n" + content = talkPage.get() + "\n\n" if url in content: - message = u'** Dead link seems to have already been reported on ' + containingPage.toggleTalkPage().aslink() + '.' + message = u'** Dead link seems to have already been reported on ' + talkPage.aslink() + '.' wikipedia.output(message, colors = [11] * len(message)) self.semaphore.release() continue @@ -565,11 +565,13 @@
if archiveURL: archiveMsg = wikipedia.translate(wikipedia.getSite(), talk_report_archive) % archiveURL - content += wikipedia.translate(wikipedia.getSite(), talk_report) % (errorReport, archiveMsg) + else: + archiveMsg = u'' + content += wikipedia.translate(wikipedia.getSite(), talk_report) % (errorReport, archiveMsg) try: - talk.put(content) + talkPage.put(content) except wikipedia.SpamfilterError, error: - message = u'** SpamfilterError while trying to change %s: %s' % (containingPage.toggleTalkPage().aslink(), error.url) + message = u'** SpamfilterError while trying to change %s: %s' % (talkPage.aslink(), error.url) wikipedia.output(message, colors = [11] * len(message))
self.semaphore.release()
pywikipedia-l@lists.wikimedia.org