diff options
author | AlexSm <alex@ydb.tech> | 2023-12-27 23:31:58 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-27 23:31:58 +0100 |
commit | d67bfb4b4b7549081543e87a31bc6cb5c46ac973 (patch) | |
tree | 8674f2f1570877cb653e7ddcff37ba00288de15a /contrib/python/prompt-toolkit/py3/prompt_toolkit/formatted_text | |
parent | 1f6bef05ed441c3aa2d565ac792b26cded704ac7 (diff) | |
download | ydb-d67bfb4b4b7549081543e87a31bc6cb5c46ac973.tar.gz |
Import libs 4 (#758)
Diffstat (limited to 'contrib/python/prompt-toolkit/py3/prompt_toolkit/formatted_text')
-rw-r--r-- | contrib/python/prompt-toolkit/py3/prompt_toolkit/formatted_text/__init__.py | 2 | ||||
-rw-r--r-- | contrib/python/prompt-toolkit/py3/prompt_toolkit/formatted_text/utils.py | 8 |
2 files changed, 7 insertions, 3 deletions
diff --git a/contrib/python/prompt-toolkit/py3/prompt_toolkit/formatted_text/__init__.py b/contrib/python/prompt-toolkit/py3/prompt_toolkit/formatted_text/__init__.py index e34db13d80..db44ab9266 100644 --- a/contrib/python/prompt-toolkit/py3/prompt_toolkit/formatted_text/__init__.py +++ b/contrib/python/prompt-toolkit/py3/prompt_toolkit/formatted_text/__init__.py @@ -16,6 +16,7 @@ from .ansi import ANSI from .base import ( AnyFormattedText, FormattedText, + OneStyleAndTextTuple, StyleAndTextTuples, Template, is_formatted_text, @@ -35,6 +36,7 @@ from .utils import ( __all__ = [ # Base. "AnyFormattedText", + "OneStyleAndTextTuple", "to_formatted_text", "is_formatted_text", "Template", diff --git a/contrib/python/prompt-toolkit/py3/prompt_toolkit/formatted_text/utils.py b/contrib/python/prompt-toolkit/py3/prompt_toolkit/formatted_text/utils.py index b242c2cc89..c8c37e0946 100644 --- a/contrib/python/prompt-toolkit/py3/prompt_toolkit/formatted_text/utils.py +++ b/contrib/python/prompt-toolkit/py3/prompt_toolkit/formatted_text/utils.py @@ -72,13 +72,15 @@ def fragment_list_to_text(fragments: StyleAndTextTuples) -> str: return "".join(item[1] for item in fragments if ZeroWidthEscape not in item[0]) -def split_lines(fragments: StyleAndTextTuples) -> Iterable[StyleAndTextTuples]: +def split_lines( + fragments: Iterable[OneStyleAndTextTuple], +) -> Iterable[StyleAndTextTuples]: """ Take a single list of (style_str, text) tuples and yield one such list for each line. Just like str.split, this will yield at least one item. - :param fragments: List of (style_str, text) or (style_str, text, mouse_handler) - tuples. + :param fragments: Iterable of ``(style_str, text)`` or + ``(style_str, text, mouse_handler)`` tuples. """ line: StyleAndTextTuples = [] |