Comment code of launching modes
parent
5e87b56a03
commit
4f9000beed
|
@ -669,14 +669,17 @@ def cli_app():
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
if 'REQUEST_URI' in os.environ:
|
if 'REQUEST_URI' in os.environ:
|
||||||
|
# mod_cgi
|
||||||
wsgiref.handlers.CGIHandler().run(cgi_wrapper)
|
wsgiref.handlers.CGIHandler().run(cgi_wrapper)
|
||||||
|
|
||||||
elif len(sys.argv) <= 1:
|
elif len(sys.argv) <= 1:
|
||||||
|
# start internal (basic) http server
|
||||||
print('Serving http://localhost:%s/'%PORT)
|
print('Serving http://localhost:%s/'%PORT)
|
||||||
httpd = wsgiref.simple_server.make_server('', PORT, cgi_wrapper)
|
httpd = wsgiref.simple_server.make_server('', PORT, cgi_wrapper)
|
||||||
httpd.serve_forever()
|
httpd.serve_forever()
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
# as a CLI app
|
||||||
try:
|
try:
|
||||||
cli_app()
|
cli_app()
|
||||||
except (KeyboardInterrupt, SystemExit):
|
except (KeyboardInterrupt, SystemExit):
|
||||||
|
|
Loading…
Reference in New Issue