diff options
author | monster <monster@ydb.tech> | 2022-07-07 14:41:37 +0300 |
---|---|---|
committer | monster <monster@ydb.tech> | 2022-07-07 14:41:37 +0300 |
commit | 06e5c21a835c0e923506c4ff27929f34e00761c2 (patch) | |
tree | 75efcbc6854ef9bd476eb8bf00cc5c900da436a2 /contrib/python/prompt-toolkit/py2/prompt_toolkit/clipboard/pyperclip.py | |
parent | 03f024c4412e3aa613bb543cf1660176320ba8f4 (diff) | |
download | ydb-06e5c21a835c0e923506c4ff27929f34e00761c2.tar.gz |
fix ya.make
Diffstat (limited to 'contrib/python/prompt-toolkit/py2/prompt_toolkit/clipboard/pyperclip.py')
-rw-r--r-- | contrib/python/prompt-toolkit/py2/prompt_toolkit/clipboard/pyperclip.py | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/contrib/python/prompt-toolkit/py2/prompt_toolkit/clipboard/pyperclip.py b/contrib/python/prompt-toolkit/py2/prompt_toolkit/clipboard/pyperclip.py deleted file mode 100644 index 61ab3aac0ab..00000000000 --- a/contrib/python/prompt-toolkit/py2/prompt_toolkit/clipboard/pyperclip.py +++ /dev/null @@ -1,39 +0,0 @@ -from __future__ import absolute_import, unicode_literals -import pyperclip - -from prompt_toolkit.selection import SelectionType -from .base import Clipboard, ClipboardData - -__all__ = ( - 'PyperclipClipboard', -) - - -class PyperclipClipboard(Clipboard): - """ - Clipboard that synchronizes with the Windows/Mac/Linux system clipboard, - using the pyperclip module. - """ - def __init__(self): - self._data = None - - def set_data(self, data): - assert isinstance(data, ClipboardData) - self._data = data - pyperclip.copy(data.text) - - def get_data(self): - text = pyperclip.paste() - - # When the clipboard data is equal to what we copied last time, reuse - # the `ClipboardData` instance. That way we're sure to keep the same - # `SelectionType`. - if self._data and self._data.text == text: - return self._data - - # Pyperclip returned something else. Create a new `ClipboardData` - # instance. - else: - return ClipboardData( - text=text, - type=SelectionType.LINES if '\n' in text else SelectionType.LINES) |