Switch to unified view

a/webui-standalone.py b/webui-standalone.py
1
#!/usr/bin/env python
1
#!/usr/bin/env python
2
import os
2
import os
3
import argparse
4
import webui
5
6
# handle command-line arguments
7
parser = argparse.ArgumentParser()
8
parser.add_argument('-a', '--addr', default='127.0.0.1',help='address to bind to [127.0.0.1]')
9
parser.add_argument('-p', '--port', default='8080', type=int, help='port to listen on [8080]')
10
args = parser.parse_args()
11
3
# change to webui's directory and import
12
# change to webui's directory and import
4
os.chdir(os.path.dirname(__file__))
13
os.chdir(os.path.dirname(__file__))
5
import webui
14
6
# set up webui and run in own http server
15
# set up webui and run in own http server
7
webui.bottle.debug(True)
16
webui.bottle.debug(True)
8
webui.bottle.run(host='localhost', port=8080, reloader=False)
17
webui.bottle.run(host=args.addr, port=args.port, reloader=False)
9
18
10
# vim: foldmethod=marker:filetype=python:textwidth=80:ts=4:et
19
# vim: foldmethod=marker:filetype=python:textwidth=80:ts=4:et