🔨 Fix config.ini custom items, and 'all' (#24720)

This commit is contained in:
ButchMonkey 2022-09-05 05:48:58 +01:00 committed by Scott Lahteine
parent b676b43874
commit cc2cc7d081

View File

@ -78,8 +78,8 @@ def apply_opt(name, val, conf=None):
elif not isdef:
break
linenum += 1
lines.insert(linenum, f"{prefix}#define {added} // Added by config.ini\n")
fullpath.write_text('\n'.join(lines), encoding='utf-8')
lines.insert(linenum, f"{prefix}#define {added:30} // Added by config.ini\n")
fullpath.write_text(''.join(lines), encoding='utf-8')
# Fetch configuration files from GitHub given the path.
# Return True if any files were fetched.
@ -127,7 +127,7 @@ def apply_ini_by_name(cp, sect):
iniok = False
items = section_items(cp, 'config:base') + section_items(cp, 'config:root')
else:
items = cp.items(sect)
items = section_items(cp, sect)
for item in items:
if iniok or not item[0].startswith('ini_'):
@ -195,8 +195,12 @@ def apply_config_ini(cp):
fetch_example(ckey)
ckey = 'base'
# Apply keyed sections after external files are done
apply_sections(cp, 'config:' + ckey)
elif ckey == 'all':
apply_sections(cp)
else:
# Apply keyed sections after external files are done
apply_sections(cp, 'config:' + ckey)
if __name__ == "__main__":
#