HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //usr/lib/python3/dist-packages/twisted/internet/__pycache__/_win32stdio.cpython-310.pyc
o

�bD�@s�dZddlZddlZddlmZddlZddlmZmZddl	m
Z
mZmZm
Z
mZddlmZee
�Gdd�d��Zeeee
�Gd	d
�d
ej��ZdS)zM
Windows-specific implementation of the L{twisted.internet.stdio} interface.
�N)�implementer)�_pollingfile�main)�IAddress�	IConsumer�IHalfCloseableProtocol�
IPushProducer�
ITransport)�Failurec@seZdZdS)�Win32PipeAddressN)�__name__�
__module__�__qualname__�rr�>/usr/lib/python3/dist-packages/twisted/internet/_win32stdio.pyrsrc@s�eZdZdZdZd"dd�Zdd�Zdd�Zd	d
�ZdZ	dd
�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd d!�ZdS)#�
StandardIOFNcCs�|dur
ddlm}tddd�D]	}t�|tj�qtj�	||�||_
t�tj
�}t�tj�}t�||j|j�|_t�||j�|_|�|j�|�|j�|j
�|�dS)z�
        Start talking to standard IO with the given protocol.

        Also, put it stdin/stdout/stderr into binary mode.
        Nr)�reactor��)�twisted.internetr�range�msvcrt�setmode�os�O_BINARYr�
_PollingTimer�__init__�proto�win32api�GetStdHandle�STD_INPUT_HANDLE�STD_OUTPUT_HANDLE�_PollableReadPipe�dataReceived�readConnectionLost�stdin�_PollableWritePipe�writeConnectionLost�stdout�_addPollableResource�makeConnection)�selfrr�stdfd�hstdin�hstdoutrrrr%s
�zStandardIO.__init__cC�|j�|�dS�N)rr#�r+�datarrrr#B�zStandardIO.dataReceivedcC�"t�|j�r|j��|��dSr0)r�
providedByrr$�
checkConnLost�r+rrrr$E�
zStandardIO.readConnectionLostcCr4r0)rr5rr'r6r7rrrr'Jr8zStandardIO.writeConnectionLostrcCs>|jd7_|jdkrd|_d|_|j�ttj��dSdS)NrrT)�	connsLost�
disconnecting�disconnectedr�connectionLostr
r�CONNECTION_DONEr7rrrr6Qs
�zStandardIO.checkConnLostcCr/r0)r(�writer1rrrr>Zr3zStandardIO.writecCs|j�d�|��dS)N�)r(r>�join)r+�seqrrr�
writeSequence]szStandardIO.writeSequencecCsd|_|j��|j��dS)NT)r:r%�closer(r7rrr�loseConnection`s
zStandardIO.loseConnectioncC�t�Sr0�rr7rrr�getPeere�zStandardIO.getPeercCrEr0rFr7rrr�getHosthrHzStandardIO.getHostcCs|j�||�Sr0)r(�registerProducer)r+�producer�	streamingrrrrJm�zStandardIO.registerProducercCs
|j��Sr0)r(�unregisterProducerr7rrrrNps
zStandardIO.unregisterProducercC�|j��dSr0)r%�
stopProducingr7rrrrPwrMzStandardIO.stopProducingcCrOr0)r%�pauseProducingr7rrrrQ|rMzStandardIO.pauseProducingcCrOr0)r%�resumeProducingr7rrrrRrMzStandardIO.resumeProducingr0)rr
rr:r;rr#r$r'r9r6r>rBrDrGrIrJrNrPrQrRrrrrrs&
	r)�__doc__rr�zope.interfacerrrrr�twisted.internet.interfacesrrrrr	�twisted.python.failurer
rrrrrrr�<module>s