dont quote . in pdict, manually trigger save for nested updates
This commit is contained in:
parent
f60cf5de10
commit
c54dd8b853
1 changed files with 3 additions and 1 deletions
|
@ -276,7 +276,7 @@ def get_local_ipv4():
|
||||||
|
|
||||||
def update_dict(root, data):
|
def update_dict(root, data):
|
||||||
for key in data:
|
for key in data:
|
||||||
keys = [part.replace('\0', '\\.') for part in key.replace('\\.', '\0').split('.')]
|
keys = [part.replace('\0', '.') for part in key.replace('\\.', '\0').split('.')]
|
||||||
value = data[key]
|
value = data[key]
|
||||||
p = root
|
p = root
|
||||||
while len(keys)>1:
|
while len(keys)>1:
|
||||||
|
@ -291,6 +291,8 @@ def update_dict(root, data):
|
||||||
del p[keys[0]]
|
del p[keys[0]]
|
||||||
else:
|
else:
|
||||||
p[keys[0]] = value
|
p[keys[0]] = value
|
||||||
|
if hasattr(root, '_save'):
|
||||||
|
root._save()
|
||||||
|
|
||||||
def remove_empty_folders(prefix):
|
def remove_empty_folders(prefix):
|
||||||
empty = []
|
empty = []
|
||||||
|
|
Loading…
Reference in a new issue