Commit a6318fae authored by koniu's avatar koniu
Browse files

py: add cli options for bind address/port

parent 699e7409
......@@ -40,7 +40,11 @@ Run standalone
Run ```` and connect to ``http://localhost:8080``.
To change the default port, edit ````.
There's some optional command-line arguments available:::
-h, --help show this help message and exit
-a ADDR, --addr ADDR address to bind to []
-p PORT, --port PORT port to listen on [8080]
#!/usr/bin/env python
import os
import argparse
import webui
# handle command-line arguments
parser = argparse.ArgumentParser()
parser.add_argument('-a', '--addr', default='',help='address to bind to []')
parser.add_argument('-p', '--port', default='8080', type=int, help='port to listen on [8080]')
args = parser.parse_args()
# change to webui's directory and import
import webui
# set up webui and run in own http server
webui.bottle.debug(True)'localhost', port=8080, reloader=False), port=args.port, reloader=False)
# vim: foldmethod=marker:filetype=python:textwidth=80:ts=4:et
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment