%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__/manhole_ssh.cpython-312.pyc

�

Ϫ�fK��V�dZddlmZddlmZddlmZmZm	Z
ddlmZddl
mZmZddlmZGd�d	�ZGd
�d�Zee
j(�Gd�d
ej*��ZGd�dej.ej*�ZGd�d�ZGd�dej4�Zy)z9
insults/SSH integration support.

@author: Jp Calderone
�)�Dict)�implementer)�avatar�error�
interfaces)�insults)�factory�session)�
componentsc��eZdZdZd�Zd�Zy)�_Gluez�
    A feeble class for making one attribute look like another.

    This should be replaced with a real class at some point, probably.
    Try not to write new code that uses it.
    c�:�|jj|�y�N)�__dict__�update)�self�kws  �;/usr/lib/python3/dist-packages/twisted/conch/manhole_ssh.py�__init__z_Glue.__init__s���
�
���R� �c�0�t|jd|��)Nzhas no attribute)�AttributeError�name)rrs  r�__getattr__z_Glue.__getattr__ s���T�Y�Y�(:�D�A�ArN)�__name__�
__module__�__qualname__�__doc__rr�rrr
r
s���!�Brr
c��eZdZd�Zy)�TerminalSessionTransportc�����|�_��_|�_�jj��jj	t�jj��fd�d����fd�}�jj	t�jj|d����jjj||�y)Nc�:���jj��Sr)�conn�	sendClose)r�protoSessions��r�<lambda>z3TerminalSessionTransport.__init__.<locals>.<lambda>/s���v�{�{�'<�'<�\�'J�rzSSH Proto Transport)�write�loseConnectionrc�:���jj�yr)�protor)�rs�rr)z9TerminalSessionTransport.__init__.<locals>.loseConnection4s����J�J�%�%�'rzChained Proto Transport)
r+r�chainedProtocolr
�makeConnectionr
�dataReceivedr(�terminalProtocol�terminalSize)rr+r-r�width�heightr)r&s`  `   @rrz!TerminalSessionTransport.__init__%s������
����.����z�z�)�)���
�
�!�!���*�*�7�7�J�*�
�	
�	(�	
���+�+���j�j�&�&�-�.�
�	
�	
���-�-�:�:�5�&�IrN�rrrrrrrr!r!$s�� Jrr!c�L�eZdZeZejZd�Zd�Z	d�Z
d�Zd�Zd�Z
y)�TerminalSessionc�(�|dd\|_|_y)N�)r3r2)r�term�
windowSize�attrss    r�getPtyzTerminalSession.getPtyMs��",�R�a�.����T�Zrc��|j||j�tj|j�|j
|j�yr)�transportFactory�chainedProtocolFactory�iconch�
IConchUser�originalr2r3)rr+s  r�	openShellzTerminalSession.openShellPs?�������'�'�)����d�m�m�,��J�J��K�K�	
rc�,�tjd��)NzCannot execute commands)�econch�
ConchError)rr+�cmds   r�execCommandzTerminalSession.execCommandYs����� 9�:�:rc��td��)Nz,Unimplemented: TerminalSession.windowChanged��NotImplementedError)r�
newWindowSizes  r�
windowChangedzTerminalSession.windowChanged\s��!�"P�Q�Qrc��td��)Nz*Unimplemented: TerminalSession.eofReceivedrJr,s r�eofReceivedzTerminalSession.eofReceived`s��!�"N�O�Orc��yrrr,s r�closedzTerminalSession.closedds��rN)rrrr!r>r�ServerProtocolr?r<rCrHrMrOrQrrrr6r6Hs4��/��$�3�3��1�
�;�R�P�
rr6c��eZdZd�Zy)�TerminalUserc��tjj||�tjj|�t
j|jd<y)Nssession)r�Adapterrr�	ConchUserr
�
SSHSession�
channelLookup)rrB�avatarIds   rrzTerminalUser.__init__jsB�����#�#�D�(�3����!�!�$�'�)0�);�);����:�&rNr4rrrrTrTis��<rrTc�D�eZdZeZeZeZe	jZd�Zdd�Z
d�Zy)�
TerminalRealmc�8�tj�}|j||�}|j|�}|j|_|j
|_|j
tj|�|j
tj|�|Sr)
r�
Componentized�userFactory�sessionFactoryr>r?�setComponentr@rA�ISession)rrZ�comp�user�sesss     r�
_getAvatarzTerminalRealm._getAvatarws}���'�'�)������h�/���"�"�4�(�� $� 5� 5���&*�&A�&A��#����&�+�+�T�2����&�/�/�4�0��rNc��|�||_yyr)r>)rr>s  rrzTerminalRealm.__init__�s���'�$4�D�!�(rc��|D]9}|tjus�tj|j|�d�fcSt��)Nc��yrrrrrr'z-TerminalRealm.requestAvatar.<locals>.<lambda>�s�r)r@rArfrK)rrZ�mindr�is     r�
requestAvatarzTerminalRealm.requestAvatar�sH���	T�A��F�%�%�%��)�)�4�?�?�8�+D�l�S�S�	T�"�#�#rr)rrrrTr_r6r`r!r>rrRr?rfrrlrrrr\r\ps-���K�$�N�/��$�3�3���5�$rr\c�D�eZdZUiZeeefed<iZeeefed<d�Zy)�ConchFactory�
publicKeys�privateKeysc��||_yr)�portal)rrrs  rrzConchFactory.__init__�s	����rN)	rrrror�bytes�__annotations__rprrrrrnrn�s-��%'�J��U�E�\�"�'�&(�K��e�U�l�#�(�rrnN)r�typingr�zope.interfacer�
twisted.conchrrrErr@�twisted.conch.insultsr�twisted.conch.sshr	r
�twisted.pythonrr
r!rbrVr6rWrTr\�
SSHFactoryrnrrr�<module>r|s���
��&�G�G�)�.�%�B�B�!J�!J�H
�V�_�_��
�j�(�(�
��
�@<�6�#�#�Z�%7�%7�<�$�$�>�7�%�%�r

Zerion Mini Shell 1.0