mirror of
https://github.com/spaam/svtplay-dl.git
synced 2024-11-27 21:54:17 +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
|
width = 50 # TODO hardcoded progressbar width
|
||||||
rel_pos = int(float(pos)/total*width)
|
rel_pos = int(float(pos)/total*width)
|
||||||
bar = str()
|
bar = ''.join(["=" * rel_pos, "." * (width - rel_pos)])
|
||||||
|
|
||||||
# FIXME ugly generation of bar
|
|
||||||
for _ in range(0, rel_pos):
|
|
||||||
bar += "="
|
|
||||||
for _ in range(rel_pos, width):
|
|
||||||
bar += "."
|
|
||||||
|
|
||||||
# Determine how many digits in total (base 10)
|
# Determine how many digits in total (base 10)
|
||||||
digits_total = len(str(total))
|
digits_total = len(str(total))
|
||||||
|
Loading…
Reference in New Issue
Block a user