diff options
author | Wugy <wugy@mally-soft.com> | 2009-12-21 18:15:56 +0100 |
---|---|---|
committer | Wugy <wugy@mally-soft.com> | 2009-12-21 18:15:56 +0100 |
commit | 7dd0c96037b0f91f761126d20e477e0e83e20825 (patch) | |
tree | d4cc7baa4e3fea8306a8ae79d2f726a226de7f78 /module/web/ServerThread.py | |
parent | pause/start button works (diff) | |
download | pyload-7dd0c96037b0f91f761126d20e477e0e83e20825.tar.xz |
total progressbar bullshit
Diffstat (limited to 'module/web/ServerThread.py')
-rw-r--r-- | module/web/ServerThread.py | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/module/web/ServerThread.py b/module/web/ServerThread.py index 2ac39c2c8..cebf0ce2f 100644 --- a/module/web/ServerThread.py +++ b/module/web/ServerThread.py @@ -1,11 +1,9 @@ #!/usr/bin/env python -from __future__ import with_statement import threading from os.path import join from subprocess import Popen, PIPE, STDOUT from time import sleep from signal import SIGINT -import os class WebServer(threading.Thread): def __init__(self, pycore): @@ -18,15 +16,13 @@ class WebServer(threading.Thread): host = self.pycore.config['webinterface']['host'] port = self.pycore.config['webinterface']['port'] self.pycore.logger.info("Starting Webserver: %s:%s" % (host,port) ) - self.p = Popen(['python',join(self.pycore.path,"module","web","manage.py"), "runserver", "%s:%s" % (host,port)], close_fds=True, stderr=PIPE, stdin=PIPE, stdout=PIPE) + self.p = Popen(['python',join(self.pycore.path,"module","web","manage.py"), "runserver", "%s:%s" % (host,port)], close_fds=True, stderr=PIPE, stdin=PIPE, stdout=PIPE, shell=False) #os.system("python " + join(self.pycore.path,"module","web","manage.py runserver %s:%s" % (host,port))) #@TODO: better would be real python code - sleep(1) - with open("webserver.pid", "r") as f: - self.pid = int(f.read().strip()) while self.running: sleep(1) def quit(self): - os.kill(self.pid, SIGINT) + self.p.terminate() self.running = False + |