From e7c95267245d226f4966f055289b061dd1bc2f91 Mon Sep 17 00:00:00 2001 From: RaNaN Date: Thu, 14 Oct 2010 16:02:08 +0200 Subject: more fixes --- module/gui/CNLServer.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'module/gui') diff --git a/module/gui/CNLServer.py b/module/gui/CNLServer.py index 7f7dc29ed..df9cd361d 100644 --- a/module/gui/CNLServer.py +++ b/module/gui/CNLServer.py @@ -45,11 +45,16 @@ class CNLServer(Thread): self.setDaemon(True) self.stop = False - self.stopped = True + self.stopped = False def run(self): server_address = ('127.0.0.1', 9666) - httpd = HTTPServer(server_address, CNLHandler) + try: + httpd = HTTPServer(server_address, CNLHandler) + except: + self.stopped = True + return + self.stopped = False while self.keep_running(): httpd.handle_request() @@ -212,9 +217,10 @@ if __name__ == "__main__": s = CNLServer() s.start() - while not s.stop: + while not s.stopped: try: s.join(1) except KeyboardInterrupt: s.stop = True + s.stopped = True print "quiting.." \ No newline at end of file -- cgit v1.2.3