summaryrefslogtreecommitdiffstats
path: root/module/web/ServerThread.py
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2010-02-13 22:48:12 +0100
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2010-02-13 22:48:12 +0100
commit9901aaf3d6ead464863039c9f1b5a88b3e3df987 (patch)
tree284c547eb15e5970667ec291fdc9fadbf1b8dbee /module/web/ServerThread.py
parentcnl fix, webif. add dialog - destionation choosable (diff)
downloadpyload-9901aaf3d6ead464863039c9f1b5a88b3e3df987.tar.xz
django builtin server improvement
Diffstat (limited to 'module/web/ServerThread.py')
-rw-r--r--module/web/ServerThread.py27
1 files changed, 5 insertions, 22 deletions
diff --git a/module/web/ServerThread.py b/module/web/ServerThread.py
index 5d0dc8738..712cd4304 100644
--- a/module/web/ServerThread.py
+++ b/module/web/ServerThread.py
@@ -64,26 +64,14 @@ class WebServer(threading.Thread):
command2 = ['lighttpd', '-D', '-f', join(path, "lighttpd", "lighttpd.conf")]
self.p2 = Popen(command2, stderr=PIPE, stdin=PIPE, stdout=PIPE)
-
-
+
else:
- self.pycore.logger.info("Starting django buildin Webserver: %s:%s" % (host, port))
+ self.pycore.logger.info("Starting django builtin Webserver: %s:%s" % (host, port))
- if os.name == 'posix':
- command = ['python', join(self.pycore.path, "module", "web", "run_unix.py"), "runserver", "%s:%s" % (host, port)]
- self.p = Popen(command, close_fds=True, stderr=PIPE, stdin=PIPE, stdout=PIPE)
- #os.system("python " + join(self.pycore.path,"module","web","manage.py runserver %s:%s" % (host,port)))
- #@TODO: better would be real python code
+ command = ['python', join(self.pycore.path, "module", "web", "run_server.py"), "%s:%s" % (host, port)]
+ self.p = Popen(command, stderr=PIPE, stdin=PIPE, stdout=PIPE)
+ while self.running:
sleep(1)
- with open("webserver.pid", "r") as f:
- self.pid = int(f.read().strip())
- while self.running:
- sleep(1)
- else:
- command = ['python', join(self.pycore.path, "module", "web", "manage.py"), "runserver", "%s:%s" % (host, port)]
- self.p = Popen(command, stderr=PIPE, stdin=PIPE, stdout=PIPE)
- while self.running:
- sleep(1)
def quit(self):
@@ -92,11 +80,6 @@ class WebServer(threading.Thread):
self.p2.kill()
return True
- if os.name == 'posix':
- try:
- os.kill(self.pid, SIGINT)
- except:
- pass
else:
self.p.kill()