new start args so it can be launched without installation; will be used for

testing


git-svn-id: svn://localhost/lasso-conform/trunk@19 2a3a78c3-912c-0410-af21-e1fb2d1df599
This commit is contained in:
fpeters 2006-11-22 10:31:56 +00:00
parent e379acddee
commit 2219f66be7
1 changed files with 19 additions and 5 deletions

View File

@ -1,25 +1,39 @@
import socket
import sys
from quixote.server.scgi_server import run
import quixote.server.scgi_server
import quixote.server.simple_server
import publisher
def start(args):
port = 3010
single_host = False
run_function = quixote.server.scgi_server.run
run_kwargs = {
'port': 3010,
'script_name': ''
}
i = 0
while i < len(args):
if args[i] == '--port':
port = int(args[i+1])
run_kwargs['port'] = int(args[i+1])
i += 1
elif args[i] == '--extra':
publisher.LcsPublisher.register_extra_dir(args[i+1])
i += 1
elif args[i] == '--app-dir':
publisher.LcsPublisher.APP_DIR = args[i+1]
i += 1
elif args[i] == '--data-dir':
publisher.LcsPublisher.DATA_DIR = args[i+1]
i += 1
elif args[i] == '--http':
run_function = quixote.server.simple_server.run
del run_kwargs['script_name']
i += 1
try:
run(publisher.LcsPublisher.create_publisher, port=port, script_name = '')
run_function(publisher.LcsPublisher.create_publisher, **run_kwargs)
except socket.error, e:
if e[0] == 98:
print >> sys.stderr, 'address already in use'