fix: demo's uses it's own console

This commit is contained in:
Daylin Morgan 2023-05-14 15:14:02 -05:00
parent 8cc214c2d4
commit f201c41b6b
Signed by: daylin
GPG key ID: C1E52E7DD81DF79F

View file

@ -1,3 +1,4 @@
import io
import sys import sys
import textwrap import textwrap
from argparse import SUPPRESS, FileType from argparse import SUPPRESS, FileType
@ -67,9 +68,7 @@ def get_parser() -> ArgumentParser:
def main() -> None: def main() -> None:
parser = get_parser() parser = get_parser()
args = parser.parse_args() args = parser.parse_args()
console = Console( console = Console(record=True, force_terminal=True)
record=True, force_terminal=args.demo, force_interactive=args.demo
)
if args.list_themes: if args.list_themes:
themes.list() themes.list()
@ -111,6 +110,7 @@ def main() -> None:
parsed_input = Text.from_ansi(args.input.read()) parsed_input = Text.from_ansi(args.input.read())
elif args.demo: elif args.demo:
console = Console(file=io.StringIO(), record=True, force_terminal=True)
parsed_input = make_test_card() # type: ignore parsed_input = make_test_card() # type: ignore
title = args.title or cmd or "yartsu" title = args.title or cmd or "yartsu"