Revision: 7680 Author: alexsh Date: 2009-11-22 22:33:38 +0000 (Sun, 22 Nov 2009)
Log Message: ----------- Fix: welcomed users not log if KeyboardInterrupt
Modified Paths: -------------- trunk/pywikipedia/welcome.py
Modified: trunk/pywikipedia/welcome.py =================================================================== --- trunk/pywikipedia/welcome.py 2009-11-22 22:17:54 UTC (rev 7679) +++ trunk/pywikipedia/welcome.py 2009-11-22 22:33:38 UTC (rev 7680) @@ -1042,7 +1042,14 @@ wikipedia.output('WARING: both -offset and -timeoffset were provided, ignoring -offset') globalvar.offset = 0 bot = WelcomeBot() - bot.run() + try: + bot.run() + except KeyboardInterrupt: + if bot.welcomed_users: + showStatus() + wikipedia.output("Put welcomed users before quit...") + bot.makelogpage(bot.welcomed_users) + wikipedia.output("Quitting...") finally: # If there is the savedata, the script must save the number_user. if globalvar.randomSign and globalvar.saveSignIndex and bot.welcomed_users: