allow inline comments with '#' in box cfg files
This commit is contained in:
@@ -16,5 +16,5 @@ eth3=192.168.127.254
|
||||
5900=192.168.2.2:5900
|
||||
|
||||
[FRAPPY]
|
||||
cfg=demo # the cfg file for the frappy server
|
||||
port=5000 # the port for the frappy server
|
||||
cfg=demo # config file
|
||||
port=5000 # port
|
||||
|
||||
@@ -49,7 +49,7 @@ all_ports = {}
|
||||
for file in sorted(cfgdir.glob('*.cfg')):
|
||||
name = file.stem
|
||||
all_ports[name] = box_ports = {}
|
||||
parser = ConfigParser()
|
||||
parser = ConfigParser(inline_comment_prefixes=('#',))
|
||||
parser.read(file)
|
||||
info = {k: dict(parser[k]) for k in parser.sections()}
|
||||
router = info.get('ROUTER', {})
|
||||
|
||||
Reference in New Issue
Block a user