Skip to content

Commit

Permalink
it just works, it just works...
Browse files Browse the repository at this point in the history
  • Loading branch information
legendofmiracles committed Oct 17, 2020
1 parent 3a29aa7 commit 105566b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion legendary/downloader/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -720,8 +720,12 @@ def pounds(perc, rest):
# base message
message = f"{perc:.02f}%"
stats = f"{hours:02d}:{minutes:02d}:{seconds:02d} {dl_speed / 1024 / 1024:.02f} Mib/s {total_dl / 1024 / 1024:.02f} MiB "

# some old math i used to used, leaving it here for reference
# rest = term_length - len(message) - ((round(shutil.get_terminal_size().columns / 2) + 2) - len(stats)) # Gets how many whitespaces we have to leave
rest = round((term_length - len(message) - len(stats)) / 3) - 1

# I have no idea how this math works...
rest = round((term_length - len(message) - len(stats)) / 3) - 1 # gets how many whitespaces we have to leave
# adds as many spaces to the message as we need...
message += ' ' * rest
message += stats
Expand Down

0 comments on commit 105566b

Please sign in to comment.