Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added graceful keyboard interrupt handler.

  • Loading branch information...
commit e63195e5428dbda4a9f779fd3992486a69108c15 1 parent c569266
@robatron robatron authored
Showing with 5 additions and 2 deletions.
  1. +5 −2 wok/dev_server.py
View
7 wok/dev_server.py
@@ -53,7 +53,7 @@ def run(self):
httpd = HTTPServer((self.host, self.port), req_handler)
socket_info = httpd.socket.getsockname()
- print("Starting dev server on http://%s:%s... (Ctrl-c to stop)"
+ print("Starting dev server on http://%s:%s... (Ctrl-C to stop)"
%(socket_info[0], socket_info[1]))
print "Serving files from", self.serv_dir
@@ -64,7 +64,10 @@ def run(self):
else:
print "Directory monitoring is OFF"
- httpd.serve_forever()
+ try:
+ httpd.serve_forever()
+ except KeyboardInterrupt:
+ print "\nStopping development server..."
class RebuildHandlerWrapper(object):
Please sign in to comment.
Something went wrong with that request. Please try again.