Revision: 7590 Author: xqt Date: 2009-11-04 09:05:42 +0000 (Wed, 04 Nov 2009)
Log Message: ----------- Keyboard interrupt handling
Modified Paths: -------------- trunk/pywikipedia/clean_sandbox.py
Modified: trunk/pywikipedia/clean_sandbox.py =================================================================== --- trunk/pywikipedia/clean_sandbox.py 2009-11-04 08:41:30 UTC (rev 7589) +++ trunk/pywikipedia/clean_sandbox.py 2009-11-04 09:05:42 UTC (rev 7590) @@ -147,7 +147,7 @@ translatedMsg = wikipedia.translate(mySite, msg) if text.strip() == translatedContent.strip(): wikipedia.output(u'The sandbox is still clean, no change necessary.') - elif text.find(translatedContent.strip()) <> 0: + elif text.find(translatedContent.strip()) <> 0 and not 'subst:' in translatedContent: sandboxPage.put(translatedContent, translatedMsg) wikipedia.output(u'Standard content was changed, sandbox cleaned.') else: @@ -186,7 +186,10 @@ return
bot = SandboxBot(hours, no_repeat, delay) - bot.run() + try: + bot.run() + except KeyboardInterrupt: + wikipedia.output('\nQuitting program...')
if __name__ == "__main__": try:
pywikipedia-svn@lists.wikimedia.org