HEX
Server: Apache
System: Linux scp1.abinfocom.com 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User: confeduphaar (1010)
PHP: 8.1.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //lib/python3/dist-packages/twisted/internet/__pycache__/_win32stdio.cpython-38.pyc
U


W[��@s�dZddlmZmZddlZddlZddlZddlmZddl	m
Z
mZmZm
Z
mZddlmZmZddlmZee�Gdd	�d	e��Zeeee
�Gd
d�dej��ZdS)zM
Windows-specific implementation of the L{twisted.internet.stdio} interface.
�)�absolute_import�divisionN)�implementer)�IHalfCloseableProtocol�
ITransport�	IConsumer�
IPushProducer�IAddress)�_pollingfile�main)�Failurec@seZdZdS)�Win32PipeAddressN)�__name__�
__module__�__qualname__�rr�>/usr/lib/python3/dist-packages/twisted/internet/_win32stdio.pyr
sr
c@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�|dkrddlm}tddd�D]}t�|tj�q tj�	||�||_
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�msvcrtZsetmode�osZO_BINARYr
�
_PollingTimer�__init__�proto�win32apiZGetStdHandleZSTD_INPUT_HANDLEZSTD_OUTPUT_HANDLEZ_PollableReadPipe�dataReceived�readConnectionLost�stdinZ_PollableWritePipe�writeConnectionLost�stdoutZ_addPollableResourceZmakeConnection)�selfrrZstdfdZhstdinZhstdoutrrrr s(��zStandardIO.__init__cCs|j�|�dS�N)rr�r$�datarrrr>szStandardIO.dataReceivedcCs"t�|j�r|j��|��dSr%)r�
providedByrr �
checkConnLost�r$rrrr Bs
zStandardIO.readConnectionLostcCs"t�|j�r|j��|��dSr%)rr(rr"r)r*rrrr"Hs
zStandardIO.writeConnectionLostrcCs:|jd7_|jdkr6d|_d|_|j�ttj��dS)NrrT)�	connsLost�
disconnecting�disconnectedrZconnectionLostrrZCONNECTION_DONEr*rrrr)Ps

zStandardIO.checkConnLostcCs|j�|�dSr%)r#�writer&rrrr.YszStandardIO.writecCs|j�d�|��dS)N�)r#r.�join)r$�seqrrr�
writeSequence]szStandardIO.writeSequencecCsd|_|j��|j��dS)NT)r,r!�closer#r*rrr�loseConnectionas
zStandardIO.loseConnectioncCst�Sr%�r
r*rrr�getPeergszStandardIO.getPeercCst�Sr%r5r*rrr�getHostkszStandardIO.getHostcCs|j�||�Sr%)r#�registerProducer)r$ZproducerZ	streamingrrrr8pszStandardIO.registerProducercCs
|j��Sr%)r#�unregisterProducerr*rrrr9tszStandardIO.unregisterProducercCs|j��dSr%)r!�
stopProducingr*rrrr:{szStandardIO.stopProducingcCs|j��dSr%)r!�pauseProducingr*rrrr;�szStandardIO.pauseProducingcCs|j��dSr%)r!�resumeProducingr*rrrr<�szStandardIO.resumeProducing)N)rrrr,r-rrr r"r+r)r.r2r4r6r7r8r9r:r;r<rrrrrs$
	r)�__doc__Z
__future__rrrrrZzope.interfacerZtwisted.internet.interfacesrrrrr	rr
rZtwisted.python.failurer�objectr
rrrrrr�<module>s