Dmitry Kirsanov commited on
Commit
8a89a6f
·
1 Parent(s): c075b07

json pickle

Browse files
Files changed (2) hide show
  1. fad.py +6 -3
  2. requirements.txt +2 -1
fad.py CHANGED
@@ -1,6 +1,7 @@
1
  import re
2
  import bidict
3
  import inspect
 
4
  from note import Note
5
 
6
  defaultnote="document"
@@ -51,9 +52,9 @@ pattern_marks = re.compile("[⌦⌫⌧]")
51
 
52
  class Fad:
53
 
54
- notes = {}
55
-
56
- highest_note_id = 0
57
 
58
  def newnote(self, type, value=None):
59
  id = self.highest_note_id + 1
@@ -416,4 +417,6 @@ if __name__ == "__main__":
416
  for id, note in f.notes.items():
417
  assert(note.needs_updating_from() == []) # in normal operation, there should be no contratemporal refs X -> something newer than X (it means X needs updating)
418
 
 
 
419
 
 
1
  import re
2
  import bidict
3
  import inspect
4
+ import jsonpickle
5
  from note import Note
6
 
7
  defaultnote="document"
 
52
 
53
  class Fad:
54
 
55
+ def __init__(self):
56
+ self.notes = {}
57
+ self.highest_note_id = 0
58
 
59
  def newnote(self, type, value=None):
60
  id = self.highest_note_id + 1
 
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
+ print(jsonpickle.encode(f, indent=4))
421
+
422
 
requirements.txt CHANGED
@@ -7,4 +7,5 @@ google-generativeai
7
  tiktoken
8
  nltk
9
  lxml
10
- unstructured
 
 
7
  tiktoken
8
  nltk
9
  lxml
10
+ unstructured
11
+ jsonpickle