Skip to content

Commit

Permalink
chore: Refactor main function to use directory path instead of zip path
Browse files Browse the repository at this point in the history
  • Loading branch information
hy20191108 committed Jun 28, 2024
1 parent 4a1624e commit 8c6da9a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/idir2pdf/idir2pdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,13 +183,13 @@ def convert(zip_any, pdfpath=None, progress=True) -> bytes:


def main() -> None:
for zippath in tqdm.tqdm(sys.argv[1:], desc="process"):
tqdm.tqdm.write(zippath)
pdfpath = os.path.splitext(zippath)[0] + ".pdf"
for dirpath in tqdm.tqdm(sys.argv[1:], desc="process"):
tqdm.tqdm.write(dirpath)
pdfpath = dirpath + ".pdf"
if os.path.isfile(pdfpath):
continue
try:
convert(zippath, pdfpath, progress=True)
convert(dirpath, pdfpath, progress=True)
except KeyboardInterrupt:
exit()

Expand Down

0 comments on commit 8c6da9a

Please sign in to comment.