fix for verbose logging with progress bar overlap

This commit is contained in:
Ivan Schaller 2022-05-16 17:22:47 +02:00
parent 280a6f7e41
commit c78f913c94

View file

@ -12,7 +12,8 @@ def download_chapter(image_urls, chapter_path, download_wait, verbose):
for img_num, img in enumerate(image_urls, 1): for img_num, img in enumerate(image_urls, 1):
# set image path # set image path
image_path = Path(f"{chapter_path}/{img_num:03d}") image_path = Path(f"{chapter_path}/{img_num:03d}")
# show progress bar # show progress bar if verbose logging is not active
if not verbose:
utils.progress_bar(img_num, total_img, verbose) utils.progress_bar(img_num, total_img, verbose)
counter = 1 counter = 1
while counter <= 3: while counter <= 3:
@ -36,7 +37,7 @@ def download_chapter(image_urls, chapter_path, download_wait, verbose):
# verbose logging # verbose logging
if verbose: if verbose:
print(f"INFO: Downloaded image {img_num}") print(f"INFO: Downloaded image {img_num}/{total_img}")
# write image # write image
try: try:
with image_path.open("wb") as file: with image_path.open("wb") as file: