A modified addict to track changes to values of fields in addict.
Caution:Note: Not all tests are passing
mydict = Dict()
mydict.a.b.c = 15
for _ in mydict.get_changed_history():
print(_)
The output
.a.b.c
Use clear_changed_history to clear all changed history.
mydict.clear_changed_history()
for _ in mydict.get_changed_history():
print(_)
outputs empty.
- Only tracks changes in values. Field additions and deletions are not being tracked.
- Every field keeps a
__tracker
variable to keep track of all its members that have changed.
- History not valid after pickle.load
- building dict from another dict following expression wont' work
cjs_cfg = Dict(x, track_changes=True)
instead use
cjs_cfg = Dict(track_changes = True)
with open("cjs_cfg.pickle", "rb") as fh:
x = pickle.load(fh)
for _ in oj.dictWalker(x):
oj.dnew(cjs_cfg, _[0], _[1])