comparison launch @ 18:e88ab99914cf draft

More improvements to the error reportage.
author David Barts <n5jrn@me.com>
date Mon, 20 May 2019 08:40:56 -0700
parents 0d47859f792a
children e93e5e746cc5
comparison
equal deleted inserted replaced
17:8186de188daf 18:e88ab99914cf
23 opt("path", default="/", help="URL path to serve", nargs='?') 23 opt("path", default="/", help="URL path to serve", nargs='?')
24 args = parser.parse_args(sys.argv[1:]) 24 args = parser.parse_args(sys.argv[1:])
25 app, errors = launch(fsroot=args.directory, urlroot=args.path) 25 app, errors = launch(fsroot=args.directory, urlroot=args.path)
26 if errors: 26 if errors:
27 sys.stderr.write("{0}: {1} error{2} detected, aborting\n".format( 27 sys.stderr.write("{0}: {1} error{2} detected, aborting\n".format(
28 sys.argv[0], errors, "" if errors == 1 else "s")) 28 MYNAME, errors, "" if errors == 1 else "s"))
29 sys.exit(1) 29 sys.exit(1)
30 app.run(host=args.bind, port=args.port) 30 app.run(host=args.bind, port=args.port)