From 00a184952733167541d72fb7d64dabeb5cd44dfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9F=D0=B0=D0=B2=D0=B5=D0=BB=20=D0=96=D1=83=D0=BA=D0=BE?= =?UTF-8?q?=D0=B2?= <33721692+LeaveMyYard@users.noreply.github.com> Date: Tue, 16 May 2023 12:17:22 +0300 Subject: [MAIN-169] Fix rich cutting long lines --- robusta_krr/utils/configurable.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'robusta_krr/utils') diff --git a/robusta_krr/utils/configurable.py b/robusta_krr/utils/configurable.py index ded2900..4777a9c 100644 --- a/robusta_krr/utils/configurable.py +++ b/robusta_krr/utils/configurable.py @@ -29,12 +29,15 @@ class Configurable(abc.ABC): def __add_prefix(text: str, prefix: str, /, no_prefix: bool) -> str: return f"{prefix} {text}" if not no_prefix else text - def print_result(self, content: str) -> None: + def print_result(self, content: str, rich: bool = True) -> None: """ Prints the result in a console. The result is always put in stdout. """ - result_console = Console() - result_console.print(content) + if rich: + result_console = Console() + result_console.print(content, overflow="ignore") + else: + print(content) def echo( self, message: str = "", *, no_prefix: bool = False, type: Literal["INFO", "WARNING", "ERROR"] = "INFO" -- cgit v1.2.3