Skip to content

Commit

Permalink
ragalahari_img_downloader.py: Update
Browse files Browse the repository at this point in the history
Update status ("Downloading" or "Downloaded") based on the percentage of completion abcbce6.
  • Loading branch information
Kajal4414 committed Feb 19, 2024
1 parent 83ba60c commit ce2e8b5
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Windows/Extra/ragalahari_img_downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
internet connection, validates image URLs, and downloads the images to a designated folder.
Author: Sakshi
Date: 02-12-2023
Date: 19-02-2024
"""

import os
Expand Down Expand Up @@ -188,9 +188,13 @@ def main():
percent = min(
int((download_size / file_size) * 100), 100
)
status = (
f"{Fore.YELLOW}Downloading{Style.RESET_ALL}"
if percent < 100
else f"{Fore.GREEN}Downloaded{Style.RESET_ALL}"
)
print(
f"{file_name_format}{Fore.GREEN} - Downloaded "
f"{percent}%{Style.RESET_ALL}",
f"{file_name_format} - {status} {percent}%",
end="\r",
)

Expand Down

0 comments on commit ce2e8b5

Please sign in to comment.