|
a |
|
b/web/scweb-standalone.py |
|
|
1 |
#!/usr/bin/env python
|
|
|
2 |
import os
|
|
|
3 |
import argparse
|
|
|
4 |
import scweb
|
|
|
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='8777', type=int, help='port to listen on [8777]')
|
|
|
10 |
args = parser.parse_args()
|
|
|
11 |
|
|
|
12 |
# change to webui's directory and import
|
|
|
13 |
os.chdir(os.path.dirname(__file__))
|
|
|
14 |
|
|
|
15 |
# set up webui and run in own http server
|
|
|
16 |
scweb.bottle.debug(True)
|
|
|
17 |
scweb.bottle.run(host=args.addr, port=args.port, reloader=False)
|