litex_term: nicer progress bar

This commit is contained in:
whitequark 2016-11-10 20:15:56 +01:00 committed by Florent Kermarrec
parent 4f3ce6db2b
commit 460185fa8e
1 changed files with 4 additions and 1 deletions

View File

@ -154,7 +154,10 @@ class LiteXTerm:
length = len(data)
start = time.time()
while len(data):
print("{}%\r".format(100*position//length), end="")
sys.stdout.write("|{}>{}| {}%\r".format('=' * (20*position//length),
' ' * (20-20*position//length),
100*position//length))
sys.stdout.flush()
frame = SFLFrame()
frame_data = data[:251]
frame.cmd = sfl_cmd_load