aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/python/prompt-toolkit/py2/prompt_toolkit/styles/utils.py
diff options
context:
space:
mode:
authormonster <monster@ydb.tech>2022-07-07 14:41:37 +0300
committermonster <monster@ydb.tech>2022-07-07 14:41:37 +0300
commit06e5c21a835c0e923506c4ff27929f34e00761c2 (patch)
tree75efcbc6854ef9bd476eb8bf00cc5c900da436a2 /contrib/python/prompt-toolkit/py2/prompt_toolkit/styles/utils.py
parent03f024c4412e3aa613bb543cf1660176320ba8f4 (diff)
downloadydb-06e5c21a835c0e923506c4ff27929f34e00761c2.tar.gz
fix ya.make
Diffstat (limited to 'contrib/python/prompt-toolkit/py2/prompt_toolkit/styles/utils.py')
-rw-r--r--contrib/python/prompt-toolkit/py2/prompt_toolkit/styles/utils.py45
1 files changed, 0 insertions, 45 deletions
diff --git a/contrib/python/prompt-toolkit/py2/prompt_toolkit/styles/utils.py b/contrib/python/prompt-toolkit/py2/prompt_toolkit/styles/utils.py
deleted file mode 100644
index 6087e76abe..0000000000
--- a/contrib/python/prompt-toolkit/py2/prompt_toolkit/styles/utils.py
+++ /dev/null
@@ -1,45 +0,0 @@
-from __future__ import unicode_literals
-from .base import DEFAULT_ATTRS, Attrs
-
-__all__ = (
- 'split_token_in_parts',
- 'merge_attrs',
-)
-
-
-def split_token_in_parts(token):
- """
- Take a Token, and turn it in a list of tokens, by splitting
- it on ':' (taking that as a separator.)
- """
- result = []
- current = []
- for part in token + (':', ):
- if part == ':':
- if current:
- result.append(tuple(current))
- current = []
- else:
- current.append(part)
-
- return result
-
-
-def merge_attrs(list_of_attrs):
- """
- Take a list of :class:`.Attrs` instances and merge them into one.
- Every `Attr` in the list can override the styling of the previous one.
- """
- result = DEFAULT_ATTRS
-
- for attr in list_of_attrs:
- result = Attrs(
- color=attr.color or result.color,
- bgcolor=attr.bgcolor or result.bgcolor,
- bold=attr.bold or result.bold,
- underline=attr.underline or result.underline,
- italic=attr.italic or result.italic,
- blink=attr.blink or result.blink,
- reverse=attr.reverse or result.reverse)
-
- return result