mirror of
https://github.com/TheCommsChannel/TC2-BBS-mesh.git
synced 2024-10-01 01:15:36 -04:00
Update config_init.py
Fix issue where server.py wouldn't run if the [sync] portion of the config.ini was commented out.
This commit is contained in:
parent
64352d4ce4
commit
4f385cffcd
@ -7,10 +7,15 @@ import serial.tools.list_ports
|
||||
def initialize_config():
|
||||
config = configparser.ConfigParser()
|
||||
config.read('config.ini')
|
||||
|
||||
interface_type = config['interface']['type']
|
||||
hostname = config['interface'].get('hostname', None)
|
||||
port = config['interface'].get('port', None)
|
||||
bbs_nodes = config['sync']['bbs_nodes'].split(',')
|
||||
port = config['interface'].get('port', None)
|
||||
|
||||
bbs_nodes = config.get('sync', 'bbs_nodes', fallback='').split(',')
|
||||
if bbs_nodes == ['']:
|
||||
bbs_nodes = []
|
||||
|
||||
return config, interface_type, hostname, port, bbs_nodes
|
||||
|
||||
def get_interface(interface_type, hostname=None, port=None):
|
||||
|
Loading…
Reference in New Issue
Block a user