Commit f2e87c6e authored by unknown's avatar unknown

Kill CherryPy when Pronterface closes

parent 069ee940
......@@ -1161,6 +1161,7 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
except:
pass
self.Destroy()
webinterface.KillWebInterfaceThread()
def do_monitor(self,l=""):
if l.strip()=="":
......@@ -1686,6 +1687,7 @@ class macroed(wx.Dialog):
self.callback(self.e.GetValue().split("\n"))
def close(self,ev):
self.Destroy()
webinterface.KillWebInterfaceThread()
def unindent(self,text):
self.indent_chars = text[:len(text)-len(text.lstrip())]
if len(self.indent_chars)==0:
......
#!/usr/bin/python
import cherrypy, pronterface, re, ConfigParser, io
import cherrypy, pronterface, re, ConfigParser, threading
import os.path
users = {}
......@@ -214,6 +214,9 @@ class WebInterfaceStub(object):
return "<b>Web Interface Must be launched by running Pronterface!</b>"
index.exposed = True
def KillWebInterfaceThread():
cherrypy.engine.exit()
def StartWebInterfaceThread(webInterface):
current_dir = os.path.dirname(os.path.abspath(__file__))
cherrypy.config.update({'engine.autoreload_on':False})
......@@ -223,7 +226,7 @@ def StartWebInterfaceThread(webInterface):
}}
cherrypy.config.update("http.config")
cherrypy.quickstart(webInterface, '/', config=conf)
if __name__ == '__main__':
cherrypy.config.update("http.config")
cherrypy.quickstart(WebInterfaceStub())
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment