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 pass
import terminatorlib.debugserver as debugserver import terminatorlib.debugserver as debugserver
(serverthread, server) = debugserver.spawn()
import threading import threading
gtk.gdk.threads_init() 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, term = Terminator (options.profile, command, options.fullscreen, options.maximise,
options.borderless, options.no_gconf) options.borderless, options.no_gconf)
(serverthread, server) = debugserver.spawn(locals())
gtk.main() gtk.main()
# guithread = threading.Thread(target=gtk.main, name="Main GUI thread") # guithread = threading.Thread(target=gtk.main, name="Main GUI thread")

View File

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