1
Fork 0
mirror of https://github.com/RGBCube/JsonWrapper synced 2025-07-27 19:57:44 +00:00

fix for same keys in pathmagic

This commit is contained in:
RGBCube 2022-01-15 16:26:56 +03:00 committed by GitHub
parent 6c23b42f71
commit b5fa0ec9e3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

4
db.py
View file

@ -21,9 +21,11 @@ class Utils:
alt_dict[key] = {} alt_dict[key] = {}
return alt_dict return alt_dict
main_dict_ref = main_dict main_dict_ref = main_dict
i = 0
for dict_name in path.split("+"): for dict_name in path.split("+"):
i += 1
main_dict = magic(main_dict, dict_name)[dict_name] main_dict = magic(main_dict, dict_name)[dict_name]
if path.split("+").index(dict_name) == len(path.split("+")) - 1: if i == len(path.split("+")):
main_dict[key] = value main_dict[key] = value
return main_dict_ref return main_dict_ref