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/conch/__pycache__/stdio.cpython-38.pyc
U


W[�
�@s�dZddlZddlZddlZddlZddlmZmZmZm	Z	ddl
mZmZm
Z
ddlmZddlmZGdd�de�ZGd	d
�d
ej�ZGdd�de�Zd
d�Zddd�Zedkr�e�dS)zC
Asynchronous local terminal input handling

@author: Jp Calderone
�N)�reactor�stdio�protocol�defer)�failure�reflect�log)�ServerProtocol)�ColoredManholec@seZdZdS)�UnexpectedOutputErrorN)�__name__�
__module__�__qualname__�rr�5/usr/lib/python3/dist-packages/twisted/conch/stdio.pyrsrc@sDeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dS)�TerminalProcessProtocolcCs||_t��|_dS�N)�protorZDeferred�onConnection)�selfrrrr�__init__sz TerminalProcessProtocol.__init__cCs"|j�|�|j�d�d|_dSr)rZmakeConnectionr�callback)rrrr�connectionMadesz&TerminalProcessProtocol.connectionMadecCs|j�|�dS)zj
        Write to the terminal.

        @param data: Data to write.
        @type data: L{bytes}
        N)�	transport�write�r�datarrrr$szTerminalProcessProtocol.writecCs|j�|�dS)zs
        Receive data from the terminal.

        @param data: Data received.
        @type data: L{bytes}
        N)rZdataReceivedrrrr�outReceived.sz#TerminalProcessProtocol.outReceivedcCs4|j��|jdk	r0|j�t�t|���d|_dS)zt
        Report an error.

        @param data: Data to include in L{Failure}.
        @type data: L{bytes}
        N)rZloseConnectionr�connectionLostrZFailurerrrrr�errReceived8s

z#TerminalProcessProtocol.errReceivedcCs|jdk	r|j�|�dSr)r�childConnectionLost)rZchildFDrrrr Es
z+TerminalProcessProtocol.childConnectionLostcCs |jdk	r|j�|�d|_dSr)rr�r�reasonrrr�processEndedJs
z$TerminalProcessProtocol.processEndedN)
rr
rrrrrrr r#rrrrrs


rc@seZdZdZdd�ZdS)�ConsoleManholezK
    A manhole protocol specifically for use with L{stdio.StandardIO}.
    cCst��dS)z�
        When the connection is lost, there is nothing more to do.  Stop the
        reactor so that the process can exit.
        N)r�stopr!rrrrUszConsoleManhole.connectionLostN)rr
r�__doc__rrrrrr$Qsr$cCs`tj��}t�|�}t�|�zt|�}t�
|�t��W5t�|tj|�t	�
|d�XdS)Ns
c
)�sys�	__stdin__�fileno�termiosZ	tcgetattr�ttyZsetrawZ	tcsetattrZTCSANOW�osrr	rZ
StandardIOr�run)�klass�fdZoldSettings�prrr�runWithProtocol^s



r1cCsJt�tdd��|dkr&tjdd�}|r:t�|d�}nt}t|�dS)Nz	child.log�w�r)	rZstartLogging�openr'�argvrZ
namedClassr$r1)r5r.rrr�mainlsr6�__main__)N)r&r,r+r'r*Ztwisted.internetrrrrZtwisted.pythonrrrZtwisted.conch.insults.insultsr	Ztwisted.conch.manholer
�	ExceptionrZProcessProtocolrr$r1r6rrrrr�<module>s 9