litex_term: nicer progress bar
authorwhitequark <whitequark@whitequark.org>
Thu, 10 Nov 2016 19:15:56 +0000 (20:15 +0100)
committerFlorent Kermarrec <florent@enjoy-digital.fr>
Wed, 30 Nov 2016 14:36:13 +0000 (15:36 +0100)
litex/soc/tools/litex_term.py

index 97fb0579a863380f7fe8b4adad4e0e6f9abc274b..53da5368beeacf1cfac7867045fb64fc1e2d9e40 100644 (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