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