diff options
| author | Павел Жуков <33721692+LeaveMyYard@users.noreply.github.com> | 2023-05-16 12:17:22 +0300 |
|---|---|---|
| committer | Павел Жуков <33721692+LeaveMyYard@users.noreply.github.com> | 2023-05-16 12:17:22 +0300 |
| commit | 00a184952733167541d72fb7d64dabeb5cd44dfc (patch) | |
| tree | 0512f100fe38a3ffd8928c0b90a74094cf2ca326 /robusta_krr/utils | |
| parent | a3887611c86c2845c12af0c1e73c8240c7f512a5 (diff) | |
[MAIN-169] Fix rich cutting long lines
Diffstat (limited to 'robusta_krr/utils')
| -rw-r--r-- | robusta_krr/utils/configurable.py | 9 |
1 files changed, 6 insertions, 3 deletions
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" |
