-
Notifications
You must be signed in to change notification settings - Fork 0
/
freeconf.py
executable file
·42 lines (31 loc) · 1.17 KB
/
freeconf.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import logging.config
from src.View.FreeconfFlask.freeconf_flask import FreeconfFlask
_author__ = 'Ondřej Lanč'
logging.config.fileConfig('logging.conf', disable_existing_loggers=False)
if __name__ == '__main__':
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('-P', '--port',
nargs='?',
default='5000',
type=int,
help='The port number for the server to listen on. '
'Defaults to 5000.'
)
parser.add_argument('-H', '--host',
nargs='?',
default='127.0.0.1',
help='The hostname or IP address for the server to '
'listen on. Defaults to 127.0.0.1.'
)
args = parser.parse_args()
port = args.port
host = args.host
freeconf = FreeconfFlask(debug=False)
import webbrowser
url = "http://{}:{}".format(host, port)
webbrowser.open_new(url)
freeconf.run(host=host, port=port)
print("Freeconf exit!")