Spaces:
Runtime error
Runtime error
Dmitry Kirsanov commited on
Commit ·
500b077
1
Parent(s): 8a89a6f
jsonpickle saving works
Browse files
fad.py
CHANGED
|
@@ -417,6 +417,13 @@ if __name__ == "__main__":
|
|
| 417 |
for id, note in f.notes.items():
|
| 418 |
assert(note.needs_updating_from() == []) # in normal operation, there should be no contratemporal refs X -> something newer than X (it means X needs updating)
|
| 419 |
|
| 420 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 421 |
|
| 422 |
|
|
|
|
| 417 |
for id, note in f.notes.items():
|
| 418 |
assert(note.needs_updating_from() == []) # in normal operation, there should be no contratemporal refs X -> something newer than X (it means X needs updating)
|
| 419 |
|
| 420 |
+
json =jsonpickle.encode(f, indent=4, keys=True)
|
| 421 |
+
with open("fad.json", "w") as fo:
|
| 422 |
+
fo.write(json)
|
| 423 |
+
|
| 424 |
+
with open("fad.json", "r") as fin:
|
| 425 |
+
fn = jsonpickle.decode(fin.read(), keys=True)
|
| 426 |
+
assert(fn.get_plaintext_with_markup("point", show_id=False, show_properties=True, properties_to_show=['concepts']) == '<point/>A<point/><point concepts="important concept 2"/>123456789B123456789C123456789')
|
| 427 |
+
|
| 428 |
|
| 429 |
|