diff options
author | shadchin <shadchin@yandex-team.ru> | 2022-02-10 16:44:39 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:44:39 +0300 |
commit | e9656aae26e0358d5378e5b63dcac5c8dbe0e4d0 (patch) | |
tree | 64175d5cadab313b3e7039ebaa06c5bc3295e274 /contrib/python/prompt-toolkit/py3/prompt_toolkit/selection.py | |
parent | 2598ef1d0aee359b4b6d5fdd1758916d5907d04f (diff) | |
download | ydb-e9656aae26e0358d5378e5b63dcac5c8dbe0e4d0.tar.gz |
Restoring authorship annotation for <shadchin@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'contrib/python/prompt-toolkit/py3/prompt_toolkit/selection.py')
-rw-r--r-- | contrib/python/prompt-toolkit/py3/prompt_toolkit/selection.py | 120 |
1 files changed, 60 insertions, 60 deletions
diff --git a/contrib/python/prompt-toolkit/py3/prompt_toolkit/selection.py b/contrib/python/prompt-toolkit/py3/prompt_toolkit/selection.py index 4dc4bf38e01..5d2545bd116 100644 --- a/contrib/python/prompt-toolkit/py3/prompt_toolkit/selection.py +++ b/contrib/python/prompt-toolkit/py3/prompt_toolkit/selection.py @@ -1,60 +1,60 @@ -""" -Data structures for the selection. -""" -from enum import Enum - -__all__ = [ - "SelectionType", - "PasteMode", - "SelectionState", -] - - -class SelectionType(Enum): - """ - Type of selection. - """ - - #: Characters. (Visual in Vi.) - CHARACTERS = "CHARACTERS" - - #: Whole lines. (Visual-Line in Vi.) - LINES = "LINES" - - #: A block selection. (Visual-Block in Vi.) - BLOCK = "BLOCK" - - -class PasteMode(Enum): - EMACS = "EMACS" # Yank like emacs. - VI_AFTER = "VI_AFTER" # When pressing 'p' in Vi. - VI_BEFORE = "VI_BEFORE" # When pressing 'P' in Vi. - - -class SelectionState: - """ - State of the current selection. - - :param original_cursor_position: int - :param type: :class:`~.SelectionType` - """ - - def __init__( - self, - original_cursor_position: int = 0, - type: SelectionType = SelectionType.CHARACTERS, - ) -> None: - - self.original_cursor_position = original_cursor_position - self.type = type - self.shift_mode = False - - def enter_shift_mode(self) -> None: - self.shift_mode = True - - def __repr__(self) -> str: - return "%s(original_cursor_position=%r, type=%r)" % ( - self.__class__.__name__, - self.original_cursor_position, - self.type, - ) +""" +Data structures for the selection. +""" +from enum import Enum + +__all__ = [ + "SelectionType", + "PasteMode", + "SelectionState", +] + + +class SelectionType(Enum): + """ + Type of selection. + """ + + #: Characters. (Visual in Vi.) + CHARACTERS = "CHARACTERS" + + #: Whole lines. (Visual-Line in Vi.) + LINES = "LINES" + + #: A block selection. (Visual-Block in Vi.) + BLOCK = "BLOCK" + + +class PasteMode(Enum): + EMACS = "EMACS" # Yank like emacs. + VI_AFTER = "VI_AFTER" # When pressing 'p' in Vi. + VI_BEFORE = "VI_BEFORE" # When pressing 'P' in Vi. + + +class SelectionState: + """ + State of the current selection. + + :param original_cursor_position: int + :param type: :class:`~.SelectionType` + """ + + def __init__( + self, + original_cursor_position: int = 0, + type: SelectionType = SelectionType.CHARACTERS, + ) -> None: + + self.original_cursor_position = original_cursor_position + self.type = type + self.shift_mode = False + + def enter_shift_mode(self) -> None: + self.shift_mode = True + + def __repr__(self) -> str: + return "%s(original_cursor_position=%r, type=%r)" % ( + self.__class__.__name__, + self.original_cursor_position, + self.type, + ) |