A very useful tool, but there is a bug in read_cfg.py, where the last block is missing. An alternative is:
def read_cfg(filename):
file=open(filename,'r')
options=[]
current={}
for i in file.readlines():
#print(i)
if(i[0]=='['):
options.append(current.copy())
current.clear()
current['type']=i.split(']')[0][1:]
pass
elif(i[0] in ['\0','#',';']):
pass
else:
read_option(i,current)
# the last block
options.append(current)
file.close()
return options[1:]
A very useful tool, but there is a bug in
read_cfg.py
, where the last block is missing. An alternative is:Thanks for your sharing!