diff options
author | Yoann QUERET <yoann@queret.net> | 2015-10-02 15:32:21 +0200 |
---|---|---|
committer | Yoann QUERET <yoann@queret.net> | 2015-10-02 15:32:21 +0200 |
commit | 3c51aa309f6ff0c38ee9d86c8a35b38cd4f6ac72 (patch) | |
tree | c4361566da5054e9ec7b87d9a69e601ec953f7f5 | |
parent | c14c89d98bf507cb548a15a763cbc0e1bf7c0e40 (diff) | |
download | dabmux-3c51aa309f6ff0c38ee9d86c8a35b38cd4f6ac72.tar.gz dabmux-3c51aa309f6ff0c38ee9d86c8a35b38cd4f6ac72.tar.bz2 dabmux-3c51aa309f6ff0c38ee9d86c8a35b38cd4f6ac72.zip |
Add ability to set socket host/port and mux host/port in argv
-rwxr-xr-x | gui/odr-dabmux-gui.py | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/gui/odr-dabmux-gui.py b/gui/odr-dabmux-gui.py index caa4ea7..1d7a37c 100755 --- a/gui/odr-dabmux-gui.py +++ b/gui/odr-dabmux-gui.py @@ -31,7 +31,8 @@ from muxconfig import * from bottle import route, run, template, static_file, request import json -conf = ConfigurationHandler('localhost') +import argparse +import requests @route('/config') def config(): @@ -112,5 +113,17 @@ def stats_json(): def send_static(filename): return static_file(filename, root='./static') -run(host='localhost', port=8000, debug=True, reloader=True) + +if __name__ == '__main__': + # Get configuration file in argument + parser = argparse.ArgumentParser(description='management server for ODR-DabMux') + parser.add_argument('--host', default='127.0.0.1', help='socket host (default: 127.0.0.1)',required=False) + parser.add_argument('--port', default='8000', help='socket port (default: 8000)',required=False) + parser.add_argument('--mhost', default='127.0.0.1', help='mux host (default: 127.0.0.1)',required=False) + parser.add_argument('--mport', default='12720', help='mux port (default: 12720)',required=False) + cli_args = parser.parse_args() + + conf = ConfigurationHandler(cli_args.mhost, cli_args.mport) + + run(host=cli_args.host, port=int(cli_args.port), debug=True, reloader=False) |