← Back
Editing: win32_pipe.cpython-311.pyc
� �Ïc@ � �� � d dl Z e j dk sJ �d dlmZ d dlmZ d dlmZ d dlm Z m Z mZmZ d dl mZ dd lmZ dd lmZ ddlmZ dd lmZ ddlmZmZmZ dgZ G d� dee� � ZdS )� N�win32)�contextmanager)�windll)�HANDLE)�Callable�ContextManager�Iterator�List)�create_win32_event� )�KeyPress��DummyContext� )� PipeInput)�Vt100Parser)�_Win32InputBase�attach_win32_input�detach_win32_input�Win32PipeInputc � � � e Zd ZdZdZdeddf� fd�Zeede d fd�� � � � Z edefd�� � Z defd �Zedefd �� � Zdeg df ded fd�Zded fd �Zdee fd�Zdee fd�Zdeddfd�Zdeddfd�Zded fd�Zded fd�Zdd�Zdefd�Z � xZ!S )r a� This is an input pipe that works on Windows. Text or bytes can be feed into the pipe, and key strokes can be read from the pipe. This is useful if we want to send the input programmatically into the application. Mostly useful for unit testing. Notice that even though it's Windows, we use vt100 escape sequences over the pipe. Usage:: input = Win32PipeInput() input.send_text('inputdata') r �_event�returnNc � �� � t � � � � � t � � � _ d� _ g � _ t � fd�� � � _ � j xj dz c_ � j j � _ d S )NFc �8 �� �j � | � � S �N)�_buffer�append)�key�selfs ��A/usr/lib/python3/dist-packages/prompt_toolkit/input/win32_pipe.py�<lambda>z)Win32PipeInput.__init__.<locals>.<lambda>4 s �� �D�L�4G�4G��4L�4L� � r ) �super�__init__r r �_closedr r �vt100_parser� __class__�_id)r r r( s ` �r! r% zWin32PipeInput.__init__'