From: whitequark Date: Thu, 10 Nov 2016 19:15:56 +0000 (+0100) Subject: litex_term: nicer progress bar X-Git-Tag: 24jan2021_ls180~1926 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=460185fa8ec0fd3cd4ae63d1fe1d17341d4e827a;p=litex.git litex_term: nicer progress bar --- diff --git a/litex/soc/tools/litex_term.py b/litex/soc/tools/litex_term.py index 97fb0579..53da5368 100644 --- a/litex/soc/tools/litex_term.py +++ b/litex/soc/tools/litex_term.py @@ -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