Revision: 7086
Author:   alexsh
Date:     2009-07-24 16:28:16 +0000 (Fri, 24 Jul 2009)

Log Message:
-----------
welcome.py: add KeyboardInterrupt exception in time.sleep(time_variable).

Modified Paths:
--------------
    trunk/pywikipedia/welcome.py

Modified: trunk/pywikipedia/welcome.py
===================================================================
--- trunk/pywikipedia/welcome.py        2009-07-24 16:26:48 UTC (rev 7085)
+++ trunk/pywikipedia/welcome.py        2009-07-24 16:28:16 UTC (rev 7086)
@@ -966,7 +966,11 @@
             else:
                 strfstr = unicode(time.strftime(u"%d %b %Y %H:%M:%S (UTC)", 
time.gmtime()))
             wikipedia.output(u'Sleeping %s seconds before rerun. %s' % 
(waitstr, strfstr))
-            time.sleep(time_variable)
+            try:
+                time.sleep(time_variable)
+            except KeyboardInterrupt:
+                recursive = False
+                break
         # If not recursive, break.
         elif recursive == False:
             yield number_user



_______________________________________________
Pywikipedia-svn mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikipedia-svn

Reply via email to