(output_dir)
| 597 | |
| 598 | |
| 599 | def extract_from_file(output_dir): |
| 600 | pdf_dir = os.path.join(output_dir, "pdf") |
| 601 | os.makedirs(pdf_dir, exist_ok=True) |
| 602 | |
| 603 | docx_dir = os.path.join(output_dir, "docx") |
| 604 | os.makedirs(docx_dir, exist_ok=True) |
| 605 | |
| 606 | png_dir = os.path.join(output_dir, "png") |
| 607 | os.makedirs(png_dir, exist_ok=True) |
| 608 | |
| 609 | for filename in os.listdir(pdf_dir): |
| 610 | f = os.path.join(pdf_dir, filename) |
| 611 | # checking if it is a file |
| 612 | # print("IN PDF") |
| 613 | if os.path.isfile(f): |
| 614 | prGreen(f) |
| 615 | extract_images_from_pdf(f, output_dir) |
| 616 | |
| 617 | # print("OUT") |
| 618 | |
| 619 | """for filename in os.listdir(docx_dir): |
| 620 | f = os.path.join(docx_dir, filename) |
| 621 | # checking if it is a file |
| 622 | print("IN DOCX") |
| 623 | if os.path.isfile(f): |
| 624 | # print(f) |
| 625 | extract_images_from_docx(f, png_dir)""" |
| 626 | |
| 627 | def clean_up_folder(target_dir): |
| 628 | if not os.path.isdir(target_dir): |
no test coverage detected