Refactored
This commit is contained in:
+6
-1
@@ -51,14 +51,19 @@ if __name__ == '__main__':
|
|||||||
last = {}
|
last = {}
|
||||||
for s in src:
|
for s in src:
|
||||||
diffed = jay_diff_full(last, s, combine_upd_add=diff_mode_update_add)
|
diffed = jay_diff_full(last, s, combine_upd_add=diff_mode_update_add)
|
||||||
|
print(f"Old: {last}")
|
||||||
|
print(f"New: {s}")
|
||||||
|
print(f"Diffed: {diffed}")
|
||||||
diffed_list.append(deepcopy(diffed))
|
diffed_list.append(deepcopy(diffed))
|
||||||
last = deepcopy(s)
|
last = deepcopy(s)
|
||||||
print(f"Diffed: {diffed}")
|
|
||||||
|
|
||||||
merged_list = []
|
merged_list = []
|
||||||
last = {}
|
last = {}
|
||||||
for d in diffed_list:
|
for d in diffed_list:
|
||||||
merged = jay_merge_full(last, d)
|
merged = jay_merge_full(last, d)
|
||||||
|
print(f"Old: {last}")
|
||||||
|
print(f"Diff: {d}")
|
||||||
|
print(f"Merged: {merged}")
|
||||||
last = deepcopy(merged)
|
last = deepcopy(merged)
|
||||||
merged_list.append(deepcopy(merged))
|
merged_list.append(deepcopy(merged))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user