Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/prompt_toolkit/input/__pycache__/posix_pipe.cpython-39.pyc
Ðазад
a d�hV � @ s� d dl mZ d dlZejdks"J �d dlZd dlmZ d dlmZm Z m Z mZ ddlm Z dd lmZ dd lmZ dgZG dd � d �ZG dd� dee�ZdS )� )�annotationsN�win32)�contextmanager)�ContextManager�Iterator�TextIO�cast� ��DummyContext� )� PipeInput)� Vt100Input�PosixPipeInputc @ sH e Zd ZdZdd�dd�Zdd�dd�Zdd�dd �Zdd�d d�ZdS ) �_PipezCWrapper around os.pipe, that ensures we don't double close any end.�None��returnc C s t �� \| _| _d| _d| _d S )NF)�os�pipe�read_fd�write_fd�_read_closed� _write_closed��self� r ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/prompt_toolkit/input/posix_pipe.py�__init__ s z_Pipe.__init__c C s | j r dS t�| j� d| _ dS )z!Close read-end if not yet closed.NT)r r �closer r r r r � close_read s z_Pipe.close_readc C s | j r dS t�| j� d| _ dS )z"Close write-end if not yet closed.NT)r r r r r r r r �close_write$ s z_Pipe.close_writec C s | � � | �� dS )zClose both read and write ends.N)r r! r r r r r , s z_Pipe.closeN)�__name__� __module__�__qualname__�__doc__r r r! r r r r r r s r c s� e Zd ZdZdZddddd�� fdd � Zeeddd d�dd ���Zddd�dd�Z ddd�dd�Z dd�dd�Zdd�dd�Zdd�dd�Z dd�dd�Z� ZS ) r a Input that is send through a pipe. This is useful if we want to send the input programmatically into the application. Mostly useful for unit testing. Usage:: with PosixPipeInput.create() as input: input.send_text('inputdata') r � r �strr )�_pipe�_textr c sT |� _ G � fdd�d�}t� �tt|� �� � �|� � j jd7 _� jj� _d S )Nc s0 e Zd ZdZdd�dd�Zdd�� fdd�Zd S ) z&PosixPipeInput.__init__.<locals>.Stdin�utf-8�boolr c S s dS )NTr ��stdinr r r �isattyG s z-PosixPipeInput.__init__.<locals>.Stdin.isatty�intc s � j jS �N)r r r, r r r �filenoJ s z-PosixPipeInput.__init__.<locals>.Stdin.filenoN)r"