mirror of
https://github.com/spaam/svtplay-dl.git
synced 2024-11-30 15:14:14 +01:00
svtplay_dl.output: prettier progressbar generation
This commit is contained in:
parent
5ef5e850e4
commit
ae8fda8963
@ -114,13 +114,7 @@ def progressbar(total, pos, msg=""):
|
||||
"""
|
||||
width = 50 # TODO hardcoded progressbar width
|
||||
rel_pos = int(float(pos)/total*width)
|
||||
bar = str()
|
||||
|
||||
# FIXME ugly generation of bar
|
||||
for _ in range(0, rel_pos):
|
||||
bar += "="
|
||||
for _ in range(rel_pos, width):
|
||||
bar += "."
|
||||
bar = ''.join(["=" * rel_pos, "." * (width - rel_pos)])
|
||||
|
||||
# Determine how many digits in total (base 10)
|
||||
digits_total = len(str(total))
|
||||
|
Loading…
Reference in New Issue
Block a user