##// END OF EJS Templates
Capturing Keyboard interrupt.
damianavila -
Show More
@@ -37,9 +37,12 b' class ServePostProcessor(PostProcessorBase):'
37 Simple implementation to serve the build directory.
37 Simple implementation to serve the build directory.
38 """
38 """
39
39
40 os.chdir(self.build_directory)
40 try:
41 httpd = HTTPServer(('127.0.0.1', 8000), SimpleHTTPRequestHandler)
41 os.chdir(self.build_directory)
42 sa = httpd.socket.getsockname()
42 httpd = HTTPServer(('127.0.0.1', 8000), SimpleHTTPRequestHandler)
43 print("Serving '" + input + "' nbconverted from ipynb on http://" + sa[0] + ":" + str(sa[1]) + "/")
43 sa = httpd.socket.getsockname()
44 print("Use Control-C to stop this server.")
44 print("Serving " + input[2:] + " on http://" + sa[0] + ":" + str(sa[1]))
45 httpd.serve_forever()
45 print("Use Control-C to stop this server.")
46 httpd.serve_forever()
47 except KeyboardInterrupt:
48 print("The server is shut down.")
General Comments 0
You need to be logged in to leave comments. Login now