cfg_load icon indicating copy to clipboard operation
cfg_load copied to clipboard

Add recursive boolean option to update

Open rjmoggach opened this issue 6 years ago • 2 comments

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 {}

rjmoggach avatar Nov 24 '19 21:11 rjmoggach

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)

rjmoggach avatar Nov 24 '19 22:11 rjmoggach

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?

MartinThoma avatar Nov 25 '19 06:11 MartinThoma