Skip to content

Commit

Permalink
Don't print every page w/out --debug
Browse files Browse the repository at this point in the history
  • Loading branch information
ashariyar committed Jun 25, 2023
1 parent 62406b2 commit 33c618a
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions clown_sort/files/pdf_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,12 @@ def extracted_text(self) -> Optional[str]:

for image_number, image in enumerate(page.images, start=1):
image_name = f"Page {page_number + 1}, Image {image_number}"
image_header = Panel(image_name, expand=False)
console_buffer.print(image_header)
console_buffer.print(Panel(image_name, expand=False))
image_obj = Image.open(io.BytesIO(image.data))
image_text = ImageFile.extract_text(image_obj, f"{self.file_path} ({image_name})")
console_buffer.print((image_text or '').strip())

page_text = console_buffer.file.getvalue()
console.print(page_text)
log.debug(page_text)
extracted_pages.append(page_text)
except DependencyError:
Expand Down

0 comments on commit 33c618a

Please sign in to comment.