cfg_load
cfg_load copied to clipboard
Add recursive boolean option to update
I have a nested dictionary that i'd like updated to be empty when I update with a user config. Ideally the top level attribute would be set to {} and then base_cfg.update(user_cfg, recursive=False) would nuke the whole dict with the user value of {}
for now i'm doing the following:
for k,v in user_cfg.items():
if k in base_cfg and base_cfg[k] != v:
base_cfg.set(k,v)
I'm not entirely sure if I understand what you want to do.
Could you give me two configuration examples (e.g. two YAML files) which show the current behavior vs the one you would like to get?