From 61aafbe028e754b9a34803552bdc016a349af7ec Mon Sep 17 00:00:00 2001 From: Thomas Hurst Date: Thu, 7 Aug 2008 14:59:10 +0100 Subject: [PATCH] Give our debugserver a reasonable starting environment --- terminator | 2 +- terminatorlib/debugserver.py | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/terminator b/terminator index c53346ef..f1864adc 100755 --- a/terminator +++ b/terminator @@ -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") diff --git a/terminatorlib/debugserver.py b/terminatorlib/debugserver.py index 17ac9ef5..38387372 100644 --- a/terminatorlib/debugserver.py +++ b/terminatorlib/debugserver.py @@ -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))