)L i\ddlmZddlZejdk(sJddlmZddlmZddlm Z ddl m Z m Z m Z ddlmZd d lmZd d lmZd d lmZd dlmZd dlmZmZmZdgZGddeeZy)) annotationsNwin32)contextmanager)windll)HANDLE)CallableContextManagerIterator)create_win32_event)KeyPress DummyContext) PipeInput) Vt100Parser)_Win32InputBaseattach_win32_inputdetach_win32_inputWin32PipeInputceZdZdZdZdfd ZeeddZe ddZ ddZ e ddZ ddZ dd Zdd Zdd Zdd Zdd ZddZddZddZddZxZS)ra 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') rctt_d_g_t fd_jxjdz c_ jj_ y)NFc:jj|SN)_bufferappend)keyselfs e/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/prompt_toolkit/input/win32_pipe.pyz)Win32PipeInput.__init__..6sDLL4G4G4Lr) super__init__r _event_closedrr vt100_parser __class___id)rr$r's` rr#zWin32PipeInput.__init__)s`  )*  (* '(LM a>>%%r!c#Kt} t|tjj |y#tjj |wxYww)Nr$)r rrkernel32 CloseHandle)clsevents rcreatezWin32PipeInput.create<sD#$ / . . OO ' ' .FOO ' ' .s A < A !AA c|jSr)r%rs rclosedzWin32PipeInput.closedEs ||r!ct)zE The windows pipe doesn't depend on the file handle. )NotImplementedErrorr1s rfilenozWin32PipeInput.filenoIs "!r!c|jS)z(  7 .. (r!) __future__rsysplatform contextlibrctypesrctypes.wintypesrtypingrr r prompt_toolkit.eventloop.win32r key_bindingr utilsrbaserr&rrrrr__all__rr!rrtsY"  ||w%"55=" %JJ  E(_iE(r!