+
    üÐjÕ
  ã                   óô   € R t ^ RIt^ RIt^ RIt^ RIt^ RIHt ^ RIHt ^ RI	H
t
HtHtHt ^ RIHtHtHt  ! R R]4      t ! R R	]P(                  4      t ! R
 R]4      tR tRR lt]R8X  d
   ]! 4        R# R# )zC
Asynchronous local terminal input handling

@author: Jp Calderone
N)ÚServerProtocol)ÚColoredManhole)ÚdeferÚprotocolÚreactorÚstdio)ÚfailureÚlogÚreflectc                   ó   € ] tR t^tRtR# )ÚUnexpectedOutputError© N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__static_attributes__r   ó    Ú5/usr/lib/python3/dist-packages/twisted/conch/stdio.pyr   r      s   † Ûr   r   c                   óJ   a € ] tR t^t o R tR tR tR tR tR t	R t
RtV tR	# )
ÚTerminalProcessProtocolc                óF   € Wn         \        P                  ! 4       V n        R # ©N)Úprotor   ÚDeferredÚonConnection)Úselfr   s   &&r   Ú__init__Ú TerminalProcessProtocol.__init__   s   € ØŒ
Ü!ŸNšNÓ,ˆÖr   c                ó€   € V P                   P                  V 4       V P                  P                  R 4       R V n        R # r   )r   ÚmakeConnectionr   Úcallback)r   s   &r   ÚconnectionMadeÚ&TerminalProcessProtocol.connectionMade   s0   € Ø�
‰
×!Ñ! $Ô'Ø×Ñ×"Ñ" 4Ô(Ø ˆÖr   c                ó<   € V P                   P                  V4       R# )zJ
Write to the terminal.

@param data: Data to write.
@type data: L{bytes}
N)Ú	transportÚwrite©r   Údatas   &&r   r&   ÚTerminalProcessProtocol.write$   s   € ð 	�‰×Ñ˜TÖ"r   c                ó<   € V P                   P                  V4       R# )zS
Receive data from the terminal.

@param data: Data received.
@type data: L{bytes}
N)r   ÚdataReceivedr'   s   &&r   ÚoutReceivedÚ#TerminalProcessProtocol.outReceived-   s   € ð 	�
‰
×Ñ Ö%r   c                óØ   € V P                   P                  4        V P                  eB   V P                  P                  \        P
                  ! \        V4      4      4       RV n        R# R# )zT
Report an error.

@param data: Data to include in L{Failure}.
@type data: L{bytes}
N)r%   ÚloseConnectionr   ÚconnectionLostr   ÚFailurer   r'   s   &&r   ÚerrReceivedÚ#TerminalProcessProtocol.errReceived6   sK   € ð 	�‰×%Ñ%Ô'Ø�:‰:Ò!Ø�J‰J×%Ñ%¤g§o¢oÔ6KÈDÓ6QÓ&RÔSØˆDŽJñ "r   c                ó\   € V P                   e   V P                   P                  V4       R # R # r   )r   ÚchildConnectionLost)r   ÚchildFDs   &&r   r5   Ú+TerminalProcessProtocol.childConnectionLostB   s#   € Ø�:‰:Ò!Ø�J‰J×*Ñ*¨7Ö3ñ "r   c                ój   € V P                   e%   V P                   P                  V4       R V n         R # R # r   )r   r0   ©r   Úreasons   &&r   ÚprocessEndedÚ$TerminalProcessProtocol.processEndedF   s*   € Ø�:‰:Ò!Ø�J‰J×%Ñ% fÔ-ØˆDŽJñ "r   )r   r   N)r   r   r   r   r   r"   r&   r,   r2   r5   r;   r   Ú__classdictcell__©Ú__classdict__s   @r   r   r      s-   ø‡ € ò-ò!ò
#ò&ò
ò4÷ð r   r   c                   ó*   a € ] tR t^Lt o RtR tRtV tR# )ÚConsoleManholezC
A manhole protocol specifically for use with L{stdio.StandardIO}.
c                ó0   € \         P                  ! 4        R# )zk
When the connection is lost, there is nothing more to do.  Stop the
reactor so that the process can exit.
N)r   Ústopr9   s   &&r   r0   ÚConsoleManhole.connectionLostQ   s   € ô
 	�ŠŽr   r   N)r   r   r   r   Ú__doc__r0   r   r=   r>   s   @r   rA   rA   L   s   ø‡ € ñ÷ð r   rA   c                 ó  € \         P                  P                  4       p\        P                  ! V4      p\
        P                  ! V4        \        P                  ! \        V 4      4       \        P                  ! 4        \        P                  ! V\        P                  V4       \        P                  ! VR 4       R#   \        P                  ! T\        P                  T4       \        P                  ! TR 4       i ; i)s   cN)ÚsysÚ	__stdin__ÚfilenoÚtermiosÚ	tcgetattrÚttyÚsetrawr   Ú
StandardIOr   r   ÚrunÚ	tcsetattrÚTCSANOWÚosr&   )ÚklassÚfdÚoldSettingss   &  r   ÚrunWithProtocolrV   Y   sœ   € Ü	�‰×	Ñ	Ó	€BÜ×#Ò# BÓ'€KÜ‡J‚Jˆr„Nð#Ü×Òœ¨Ó.Ô/Ü�ŠŒä×Ò˜"œgŸo™o¨{Ô;Ü
�Š��\Ö"øô 	×Ò˜"œgŸo™o¨{Ô;Ü
�Š��\Õ"ús   Á4B? Â??C>c                 óê   € \         P                  ! \        R R4      4       V f   \        P                  R,          p V '       d   \
        P                  ! V ^ ,          4      pM\        p\        V4       R# )z	child.logÚwN:é   NN)	r	   ÚstartLoggingÚopenrG   Úargvr
   Ú
namedClassrA   rV   )r\   rS   s   & r   Úmainr^   e   sM   € Ü×Ò”T˜+ sÓ+Ô,à‚|Ü�x‰x˜�|ˆßÜ×"Ò" 4¨¥7Ó+‰äˆÜ�EÖr   Ú__main__r   )rE   rR   rG   rJ   rL   Útwisted.conch.insults.insultsr   Útwisted.conch.manholer   Útwisted.internetr   r   r   r   Útwisted.pythonr   r	   r
   Ú	Exceptionr   ÚProcessProtocolr   rA   rV   r^   r   r   r   r   Ú<module>rf      ss   ðñ
ó 
Û 
Û Û 
å 8Ý 0ß <Ó <ß 0Ñ 0ô	˜Iô 	ô/˜h×6Ñ6ô /ôd
�^ô 
ò	#ô	ð ˆzÔÙ†Fñ r   