mirror of
https://github.com/3b1b/manim.git
synced 2025-08-05 16:49:03 +00:00
Limit how much is shown in display_during_execution
This commit is contained in:
parent
7b8677fd6c
commit
42a3c56898
1 changed files with 4 additions and 2 deletions
|
@ -128,8 +128,10 @@ def dvi_to_svg(dvi_file, regen_if_exists=False):
|
||||||
# TODO, perhaps this should live elsewhere
|
# TODO, perhaps this should live elsewhere
|
||||||
@contextmanager
|
@contextmanager
|
||||||
def display_during_execution(message):
|
def display_during_execution(message):
|
||||||
|
# Only show top line
|
||||||
|
to_print = message.split("\n")[0]
|
||||||
try:
|
try:
|
||||||
print(message, end="\r")
|
print(to_print, end="\r")
|
||||||
yield
|
yield
|
||||||
finally:
|
finally:
|
||||||
print(" " * len(message), end="\r")
|
print(" " * len(to_print), end="\r")
|
||||||
|
|
Loading…
Add table
Reference in a new issue