← Back
Editing: clipboard.cpython-311.pyc
� �@�c� � �r � d Z ddlZddlZddlmZ ddlmc mZ G d� de� � Z d� Z defd�Zd � Z d � ZdS )z3 Utilities for accessing the platform's clipboard. � N)�TryNextc � � e Zd ZdS )�ClipboardEmptyN)�__name__� __module__�__qualname__� � �7/usr/lib/python3/dist-packages/IPython/lib/clipboard.pyr r s � � � � � ��Dr r c � � ddl } n"# t $ r}t d� � |�d}~ww xY w| � � � | � | j � � }ns# t | j f$ r_ | � | j � � }t j |t j � � }n!# t | j f$ r }t |�d}~ww xY wY nw xY w| � � � n# | � � � w xY w|S )zc Get the current clipboard's text on Windows. Requires Mark Hammond's pywin32 extensions. r NziGetting text from the clipboard requires the pywin32 extensions: http://sourceforge.net/projects/pywin32/)�win32clipboard�ImportErrorr � OpenClipboard�GetClipboardData�CF_UNICODETEXT� TypeError�error�CF_TEXT� py3compat�cast_unicode�DEFAULT_ENCODINGr �CloseClipboard)r �e�texts r �win32_clipboard_getr sH � � U�������� U� U� U�� M� N� N�ST� U�����U���� � � �"�"�"� (��.�.�~�/L�M�M�����~�+�,� (� (� (� (�!�2�2�>�3I�J�J�D��)�$� �0J�K�K�D�D���>�/�0� (� (� (� �a�'����� (���� �D�(���� �%�%�'�'�'�'���%�%�'�'�'�'�����Ks] � � &�!�&�A �C! �C �+9B%�$C �%C�6B>�>C�C �C! �C � C! �!C7�returnc �� � t j g d�t j �� � } | � � � \ }}|� dd� � }t j |� � }|S )z' Get the clipboard's text on OS X. )�pbpastez-Prefer�ascii��stdout� � )� subprocess�Popen�PIPE�communicate�replacer �decode)�p�bytes_�stderrr s r �osx_clipboard_getr- &