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__/_posixstdio.cpython-38.pyc
U

��W[O�@sxdZddlmZddlmZmZmZddlmZm	Z	eej
�Gdd�de��Zeej
ejejej�Gdd�de��Zd	S)
z�Standard input/out/err support.

Future Plans::

    support for stderr, perhaps
    Rewrite to use the reactor instead of an ad-hoc mechanism for connecting
        protocols to transport.

Maintainer: James Y Knight
�)�implementer)�process�error�
interfaces)�log�failurec@seZdZdS)�PipeAddressN)�__name__�
__module__�__qualname__�rr�>/usr/lib/python3/dist-packages/twisted/internet/_posixstdio.pyrsrc@s�eZdZdZdZdZdZd+dd�Zdd�Zd	d
�Z	dd�Z
d
d�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�ZdS),�
StandardIONFr�cCsX|dkrddlm}||_t�||d|�|_t�||d|�|_|j��|j�	|�dS)Nr)�reactor�write�read)
�twisted.internetr�protocolrZ
ProcessWriter�_writerZ
ProcessReader�_reader�startReadingZmakeConnection)�self�proto�stdin�stdoutrrrr
�__init__"s
zStandardIO.__init__cCs|jdk	r|j��dS�N)r�loseConnection�rrrr
�loseWriteConnection/s
zStandardIO.loseWriteConnectioncCs|jdk	r|j�|�dSr)rr�r�datarrr
r3s
zStandardIO.writecCs|jdk	r|j�|�dSr)r�
writeSequencer!rrr
r#7s
zStandardIO.writeSequencecCs2d|_|jdk	r|j��|jdk	r.|j��dS�NT)�
disconnectingrrr�stopReadingrrrr
r;s



zStandardIO.loseConnectioncCst�Sr�rrrrr
�getPeerDszStandardIO.getPeercCst�Srr'rrrr
�getHostGszStandardIO.getHostcCs|j�|�dSr)rZdataReceived)r�fdr"rrr
�childDataReceivedLszStandardIO.childDataReceivedcCsF|jr
dS|jjtjkr8|dkr,|�|�qB|�|�n
|�|�dS)Nr)�disconnected�value�	__class__rZConnectionDone�_readConnectionLost�_writeConnectionLost�connectionLost)rr*�reasonrrr
�childConnectionLostOszStandardIO.childConnectionLostcCs�d|_|j}|j}|j}d|_|_d|_|dk	rB|jsB|�|�|dk	rZ|jsZ|�|�z|�|�Wnt��YnXdSr$)r,rrrr1r�err)rr2rrrrrr
r1\s

zStandardIO.connectionLostcCs`d|_|jr|�|�dSt�|jd�}|r\z|��Wn"t��|�t	�
��YnXdSr)rr%r1r�IHalfCloseableProtocolrZwriteConnectionLostrr4r�Failure�rr2�prrr
r0qs
zStandardIO._writeConnectionLostcCsXd|_t�|jd�}|rJz|��WqTt��|�t�	��YqTXn
|�|�dSr)
rrr5rZreadConnectionLostrr4r1rr6r7rrr
r/szStandardIO._readConnectionLostcCs&|jdkr|��n|j�||�dSr)r�
stopProducing�registerProducer)rZproducerZ	streamingrrr
r:�s

zStandardIO.registerProducercCs|jdk	r|j��dSr)r�unregisterProducerrrrr
r;�s
zStandardIO.unregisterProducercCs|��dSr)rrrrr
r9�szStandardIO.stopProducingcCs|jdk	r|j��dSr)r�pauseProducingrrrr
r<�s
zStandardIO.pauseProducingcCs|jdk	r|j��dSr)r�resumeProducingrrrr
r=�s
zStandardIO.resumeProducingcCs|��dS)z3Compatibility only, don't use. Call pauseProducing.N)r<rrrr
r&�szStandardIO.stopReadingcCs|��dS)z4Compatibility only, don't use. Call resumeProducing.N)r=rrrr
r�szStandardIO.startReading)rrN)r	r
rrrr,r%rr rr#rr(r)r+r3r1r0r/r:r;r9r<r=r&rrrrr
rs.

	

rN)�__doc__Zzope.interfacerrrrrZtwisted.pythonrrZIAddress�objectrZ
ITransportZ	IProducerZ	IConsumerZIHalfCloseableDescriptorrrrrr
�<module>s
�