Skip to content

Commit

Permalink
TextStorage class
Browse files Browse the repository at this point in the history
  • Loading branch information
blindsphynx committed Nov 24, 2023
1 parent e54b162 commit 3b92690
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions app/main/reports/text_storage/text_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,10 @@ def parse_chapters(self):


if __name__ == "__main__":
docx_path = "/home/vilka/Downloads/petrov.docx"
pdf_path = "/home/vilka/Downloads/petrov.pdf"
docx_path = "example.docx"
pdf_path = "example.pdf"
text_storage = TextStorage(docx_path, pdf_path)
text_storage.parse_chapters()
text_storage.parse_headers_and_pages()
# for ch in text_storage.chapters:
# print(ch)

with open("pickle.bin", "wb") as outfile:
pickle.dump(text_storage.chapters, outfile)

with open("pickle.bin", "rb") as infile:
deserialized = pickle.load(infile)

if text_storage.chapters == deserialized:
print("Serialization is successful")

0 comments on commit 3b92690

Please sign in to comment.