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): ...@@ -1161,6 +1161,7 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
except: except:
pass pass
self.Destroy() self.Destroy()
webinterface.KillWebInterfaceThread()
def do_monitor(self,l=""): def do_monitor(self,l=""):
if l.strip()=="": if l.strip()=="":
...@@ -1686,6 +1687,7 @@ class macroed(wx.Dialog): ...@@ -1686,6 +1687,7 @@ class macroed(wx.Dialog):
self.callback(self.e.GetValue().split("\n")) self.callback(self.e.GetValue().split("\n"))
def close(self,ev): def close(self,ev):
self.Destroy() self.Destroy()
webinterface.KillWebInterfaceThread()
def unindent(self,text): def unindent(self,text):
self.indent_chars = text[:len(text)-len(text.lstrip())] self.indent_chars = text[:len(text)-len(text.lstrip())]
if len(self.indent_chars)==0: if len(self.indent_chars)==0:
......
#!/usr/bin/python #!/usr/bin/python
import cherrypy, pronterface, re, ConfigParser, io import cherrypy, pronterface, re, ConfigParser, threading
import os.path import os.path
users = {} users = {}
...@@ -214,6 +214,9 @@ class WebInterfaceStub(object): ...@@ -214,6 +214,9 @@ class WebInterfaceStub(object):
return "<b>Web Interface Must be launched by running Pronterface!</b>" return "<b>Web Interface Must be launched by running Pronterface!</b>"
index.exposed = True index.exposed = True
def KillWebInterfaceThread():
cherrypy.engine.exit()
def StartWebInterfaceThread(webInterface): def StartWebInterfaceThread(webInterface):
current_dir = os.path.dirname(os.path.abspath(__file__)) current_dir = os.path.dirname(os.path.abspath(__file__))
cherrypy.config.update({'engine.autoreload_on':False}) cherrypy.config.update({'engine.autoreload_on':False})
......
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