This repository has been archived on 2023-02-21. You can view files and clone it, but cannot push or open issues or pull requests.
lcs/lcs/ctl/start.py

31 lines
689 B
Python

import socket
import sys
from quixote.server.scgi_server import run
import publisher
def start(args):
port = 3010
single_host = False
i = 0
while i < len(args):
if args[i] == '--port':
port = int(args[i+1])
i += 1
elif args[i] == '--extra':
publisher.LcsPublisher.register_extra_dir(args[i+1])
i += 1
i += 1
try:
run(publisher.LcsPublisher.create_publisher, port=port, script_name = '')
except socket.error, e:
if e[0] == 98:
print >> sys.stderr, 'address already in use'
sys.exit(1)
raise
except KeyboardInterrupt:
sys.exit(1)