Skip to content

Commit

Permalink
reverting to ab60cbe
Browse files Browse the repository at this point in the history
  • Loading branch information
ekong5 committed Aug 20, 2024
1 parent 37f2514 commit d0f7261
Showing 1 changed file with 7 additions and 14 deletions.
21 changes: 7 additions & 14 deletions src/backend/expungeservice/form_filling.py
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ def __init__(self, path: str):
self.writer = PdfWriter()
try:
print(stat(path))
self._pdf = PdfReader()
self._pdf = PdfReader(path)
print("file opened by reader")
except Exception as e:
with open(path, 'wb') as f:
Expand Down Expand Up @@ -728,20 +728,13 @@ def _create_pdf(source_data: UserInfo, validate_initial_pdf_state=False) -> PDF:

@staticmethod
def _create_and_write_summary_pdf(file_name: str, markdown: bytes, temp_dir: str):
# TODO: remove file_name, temp_dir arguments,
# source_dir = path.join(Path(__file__).parent, "files")
# pdf_path = path.join(source_dir, file_name)
# pdf = SUMMARY_REPORT(pdf_path)
source_dir = path.join(Path(__file__).parent, "files")
pdf_path = path.join(source_dir, file_name)
pdf = SUMMARY_REPORT(pdf_path)

# pdf.add_text(markdown)
# write_file_path, write_file_name = path.join(temp_dir, file_name), file_name
# pdf.writer.write(write_file_path)
write_file_name = "temp_summary_file"
write_file_path = path.join(Path(__file__).parent, write_file_name)
with open(write_file_path, 'wb') as f:
f.write(markdown)


pdf.add_text(markdown)
write_file_path, write_file_name = path.join(temp_dir, file_name), file_name
pdf.writer.write(write_file_path)
return write_file_path, write_file_name


Expand Down

0 comments on commit d0f7261

Please sign in to comment.