Файловый менеджер - Редактировать - /home/digitalm/venv/lib/python3.7/site-packages/pandas/io/clipboard/__pycache__/__init__.cpython-37.pyc
Назад
B �5�gT � @ sv d Z dZddlZddlZddlmZmZmZmZmZ ddl Z ddl Z ddlmZ ddl Z ddlZddlZe �dd�ZdZd Ze �� d kr�dZndZd d� ZG dd� de�ZG dd� de�Zed�dd�Zdd� Zdd� Zdd� Zdd� Zdd� Z d d!� Z!d"d#� Z"d$d%� Z#G d&d'� d'�Z$d(d)� Z%d*d+� Z&d,d-� Z'd.d/� Z(d0d1� Z)d2d3� Z*e+d�d4d5�Z,e)e* a-a.d6d7d/d-gZ/t.Z0t-Z1dS )8ae Pyperclip A cross-platform clipboard module for Python, with copy & paste functions for plain text. By Al Sweigart al@inventwithpython.com BSD License Usage: import pyperclip pyperclip.copy('The text to be copied to the clipboard.') spam = pyperclip.paste() if not pyperclip.is_available(): print("Copy functionality unavailable!") On Windows, no additional modules are needed. On Mac, the pyobjc module is used, falling back to the pbcopy and pbpaste cli commands. (These commands should come with OS X.). On Linux, install xclip or xsel via package manager. For example, in Debian: sudo apt-get install xclip sudo apt-get install xsel Otherwise on Linux, you will need the PyQt5 modules installed. This module does not work with PyGObject yet. Cygwin is currently not supported. Security Note: This module runs programs with these names: - which - where - pbcopy - pbpaste - xclip - xsel - klipper - qdbus A malicious user could rename or add programs with these names, tricking Pyperclip into running them with whatever permissions the Python process has. z1.7.0� N)�c_size_t�c_wchar� c_wchar_p� get_errno�sizeof)�whichZDISPLAYFz� Pyperclip could not find a copy/paste mechanism for your system. For more information, please visit https://pyperclip.readthedocs.io/en/latest/#not-implemented-error zutf-8�Windows�wherer c C s t jt| gt jt jd�dkS )N)�stdout�stderrr )� subprocess�call� WHICH_CMD�PIPE)�name� r �R/home/digitalm-up/venv/lib/python3.7/site-packages/pandas/io/clipboard/__init__.py�_executable_existsQ s r c @ s e Zd ZdS )�PyperclipExceptionN)�__name__� __module__�__qualname__r r r r r [ s r c s e Zd Z� fdd�Z� ZS )�PyperclipWindowsExceptionc s$ |dt �� � d�7 }t� �|� d S )Nz (�))�ctypesZWinError�super�__init__)�self�message)� __class__r r r ` s z"PyperclipWindowsException.__init__)r r r r � __classcell__r r )r r r _ s r )�returnc C s2 t tttf}t| |�s*tdt| �j� ���t | �S )NzJonly str, int, float, and bool values can be copied to the clipboard, not )�str�int�float�bool� isinstancer �typer )�textZ acceptedTypesr r r �_stringifyTexte s r) c C s dd� } dd� }| |fS )Nc S s4 t | �} tjddgtjdd�}|j| �t�d� d S )N�pbcopy�wT)�stdin� close_fds)�input)r) r �Popenr �communicate�encode�ENCODING)r( �pr r r �copy_osx_pbcopyp s z2init_osx_pbcopy_clipboard.<locals>.copy_osx_pbcopyc S s, t jddgt jdd�} | �� \}}|�t�S )NZpbpaste�rT)r r- )r r/ r r0 �decoder2 )r3 r r r r r �paste_osx_pbcopyu s z3init_osx_pbcopy_clipboard.<locals>.paste_osx_pbcopyr )r4 r7 r r r �init_osx_pbcopy_clipboardo s r8 c C s dd� } dd� }| |fS )Nc S sP t | �} tj�| ��� }|�tj�}tj� � }|� tjgd� |�|tj� dS )z!Copy string argument to clipboardN) r) � FoundationZNSStringZstringWithString_ZnsstringZdataUsingEncoding_ZNSUTF8StringEncoding�AppKit�NSPasteboard�generalPasteboardZdeclareTypes_owner_�NSStringPboardTypeZsetData_forType_)r( ZnewStrZnewData�boardr r r �copy_osx_pyobjc~ s z2init_osx_pyobjc_clipboard.<locals>.copy_osx_pyobjcc S s t j�� } | �t j�}|S )zReturns contents of clipboard)r: r; r<