Give our debugserver a reasonable starting environment

This commit is contained in:
Thomas Hurst 2008-08-07 14:59:10 +01:00
parent d0d81fc152
commit 61aafbe028
2 changed files with 6 additions and 3 deletions

View File

@ -144,7 +144,6 @@ See the following bug report for more details:
pass
import terminatorlib.debugserver as debugserver
(serverthread, server) = debugserver.spawn()
import threading
gtk.gdk.threads_init()
@ -153,6 +152,7 @@ See the following bug report for more details:
term = Terminator (options.profile, command, options.fullscreen, options.maximise,
options.borderless, options.no_gconf)
(serverthread, server) = debugserver.spawn(locals())
gtk.main()
# guithread = threading.Thread(target=gtk.main, name="Main GUI thread")

View File

@ -18,9 +18,11 @@ import rlcompleter
import re
class PythonConsoleServer(SocketServer.BaseRequestHandler):
env = None
def setup(self):
dbg('debugserver: connect from %s' % str(self.client_address))
self.console = TerminatorConsole()
dbg('debugserver: env=%s' % repr(PythonConsoleServer.env))
self.console = TerminatorConsole(PythonConsoleServer.env)
def handle(self):
dbg("debugserver: handling")
@ -138,8 +140,9 @@ def server():
print "Serving on %s" % str(tcpserver.server_address)
tcpserver.serve_forever()
def spawn():
def spawn(env):
# server()
PythonConsoleServer.env = env
# tcpserver = SocketServer.ThreadingTCPServer(('', 0), PythonConsoleServer)
tcpserver = SocketServer.TCPServer(('', 0), PythonConsoleServer)
print("debugserver: listening on %s" % str(tcpserver.server_address))