mirror of
https://github.com/JonasunderscoreJones/turbo-octo-potato.git
synced 2025-10-26 02:29:18 +01:00
Fixed issue with the progress bar
Added easteregg with 69%
This commit is contained in:
parent
8935c9e11e
commit
bcb1c14a73
1 changed files with 5 additions and 1 deletions
|
|
@ -209,7 +209,11 @@ class Progressbar:
|
||||||
progress_bar_length = width - 2*total_num_len - 13 - len(str(eta)) - len(percent)
|
progress_bar_length = width - 2*total_num_len - 13 - len(str(eta)) - len(percent)
|
||||||
progress_bar_progress = round((current/self.total)*progress_bar_length)
|
progress_bar_progress = round((current/self.total)*progress_bar_length)
|
||||||
progress_bar_spacer = " "*(progress_bar_length-progress_bar_progress)
|
progress_bar_spacer = " "*(progress_bar_length-progress_bar_progress)
|
||||||
return f"[{current_spacer}{current}/{self.total}|{percent}%|ETA: {eta}|{'='*progress_bar_progress}>{progress_bar_spacer}]"
|
return f"[{current_spacer}{current}/{self.total}|{percent}%|ETA: {eta}|{'~'*progress_bar_progress if percent == ' 69' else '='*progress_bar_progress}>{progress_bar_spacer}]"
|
||||||
|
|
||||||
|
def print(self, current: int, eta: int=None) -> None:
|
||||||
|
"""Print progressbar"""
|
||||||
|
print(self.buildSnapshot(current, eta), end="\r")
|
||||||
|
|
||||||
|
|
||||||
class ProgressBarEtaManager:
|
class ProgressBarEtaManager:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue