|
@@ -73,24 +73,29 @@ def set_conf(name, args):
|
73
|
73
|
|
74
|
74
|
|
75
|
75
|
if args.interface is not None:
|
76
|
|
- if args.interface not in ('web', 'python'):
|
|
76
|
+ iarg = args.interface
|
|
77
|
+ if iarg not in ('web', 'python'):
|
77
|
78
|
raise TypeError("Interface can only be on of : 'web', 'python'")
|
78
|
|
- config['lodel2']['interface'] = args.interface
|
|
79
|
+ if iarg.lower() == 'web':
|
|
80
|
+ iarg = 'webui'
|
|
81
|
+ else:
|
|
82
|
+ iarg = ''
|
|
83
|
+ config['lodel2']['interface'] = iarg
|
79
|
84
|
interface = config['lodel2']['interface']
|
80
|
|
- if interface == 'web':
|
81
|
|
- if 'lodel.webui' not in config:
|
82
|
|
- config['lodel.webui'] = dict()
|
83
|
|
- config['lodel.webui']['standalone'] = 'True'
|
|
85
|
+ if interface == 'webui':
|
|
86
|
+ if 'lodel2.webui' not in config:
|
|
87
|
+ config['lodel2.webui'] = dict()
|
|
88
|
+ config['lodel2.webui']['standalone'] = 'True'
|
84
|
89
|
if args.listen_port is not None:
|
85
|
|
- config['lodel.webui']['listen_port'] = str(args.listen_port)
|
|
90
|
+ config['lodel2.webui']['listen_port'] = str(args.listen_port)
|
86
|
91
|
if args.listen_address is not None:
|
87
|
|
- config['lodel.webui']['listen_address'] = str(args.listen_address)
|
|
92
|
+ config['lodel2.webui']['listen_address'] = str(args.listen_address)
|
88
|
93
|
else: #interface is python
|
89
|
94
|
if args.listen_port is not None or args.listen_address is not None:
|
90
|
95
|
logging.error("Listen port and listen address will not being set. \
|
91
|
96
|
Selected interface is not the web iterface")
|
92
|
97
|
if 'lodel.webui' in config:
|
93
|
|
- del(config['lodel.webui'])
|
|
98
|
+ del(config['lodel2.webui'])
|
94
|
99
|
#Now config should be OK to be written again in conffile
|
95
|
100
|
with open(conffile, 'w+') as cfp:
|
96
|
101
|
config.write(cfp)
|