From 415ef1cab466ee3ce108afca085731afaa870c69 Mon Sep 17 00:00:00 2001 From: Thomas Aglassinger Date: Sun, 30 May 2021 13:27:45 +0200 Subject: [PATCH] #41 Clean up alignment of progress percentage. --- humblebundle_downloader/download_library.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/humblebundle_downloader/download_library.py b/humblebundle_downloader/download_library.py index 33dee61..6bbe4ba 100644 --- a/humblebundle_downloader/download_library.py +++ b/humblebundle_downloader/download_library.py @@ -365,8 +365,8 @@ def _download_file(self, product_r, local_filename): pb_width = 50 done = int(pb_width * dl / total_length) if self.progress_bar: - print("\t{percent}% [{filler}{space}]" - .format(percent=int(done * (100 / pb_width)), + print("\t{percent:3d}% [{filler}{space}]" + .format(percent=done * 100 // pb_width, filler='=' * done, space=' ' * (pb_width - done), ), end='\r')