Ctl: add --http, --data-dir and --app-dir options
* wcs/ctl/start.py: add similar option to authentic, for --http I had to remove the 'spawn_cron' arguments to run because it is not supported by quixote.server.simple_server.run. But usually the '--http' option is for testing.
This commit is contained in:
parent
8a185d160b
commit
ecfa0534e0
|
@ -1,6 +1,7 @@
|
|||
import socket
|
||||
import sys
|
||||
from qommon.scgi_server import run
|
||||
import qommon.scgi_server
|
||||
import quixote.server.simple_server
|
||||
|
||||
import publisher
|
||||
|
||||
|
@ -8,6 +9,7 @@ def start(args):
|
|||
run_kwargs = {}
|
||||
run_kwargs['port'] = 3001
|
||||
run_kwargs['spawn_cron'] = True
|
||||
run_function = qommon.scgi_server.run
|
||||
|
||||
i = 0
|
||||
while i < len(args):
|
||||
|
@ -20,10 +22,21 @@ def start(args):
|
|||
elif args[i] == '--script-name':
|
||||
run_kwargs['script_name'] = args[i+1]
|
||||
i += 1
|
||||
elif args[i] == '--app-dir':
|
||||
print 'boob'
|
||||
publisher.WcsPublisher.APP_DIR = args[i+1]
|
||||
i += 1
|
||||
elif args[i] == '--data-dir':
|
||||
print 'coin'
|
||||
publisher.WcsPublisher.DATA_DIR = args[i+1]
|
||||
i += 1
|
||||
elif args[i] == '--http':
|
||||
del run_kwargs['spawn_cron']
|
||||
run_function = quixote.server.simple_server.run
|
||||
i += 1
|
||||
|
||||
try:
|
||||
run(publisher.WcsPublisher.create_publisher, **run_kwargs)
|
||||
run_function(publisher.WcsPublisher.create_publisher, **run_kwargs)
|
||||
except socket.error, e:
|
||||
if e[0] == 98:
|
||||
print >> sys.stderr, 'address already in use'
|
||||
|
|
Loading…
Reference in New Issue