
    h                        S r SSKrSSKr\R                  R	                  \R
                  S   5      R                  \R                  S-   5      r\S:w  aH  \R                  R                  S\R                  R	                  \R
                  S   5      S\S-    5        \R                  R                  S\R                  5        SSKJr  SSKJr  SSKJr  \R"                  " \R$                  5        SS	KJrJrJr  \" \R,                  5       " S
 S\R.                  5      5       r\R2                  " \" 5       5        \R4                  " 5         g)z6A process that reads from stdin and out using Twisted.    NTwisted   )implementer)
interfaces)log)protocolreactorstdioc                   2    \ rS rSrS rS rS rS rS rSr	g)	Echo   c                     [        S5        g )Nzconnection madeprintselfs    c/root/1688_scrapy/alibaba-scraper/venv/lib/python3.13/site-packages/twisted/test/process_twisted.pyconnectionMadeEcho.connectionMade   s         c                 :    U R                   R                  U5        g )N)	transportwrite)r   datas     r   dataReceivedEcho.dataReceived!   s    T"r   c                 N    [        S5        U R                  R                  5         g )NreadConnectionLost)r   r   loseConnectionr   s    r   r   Echo.readConnectionLost$   s    "#%%'r   c                     [        S5        g )NwriteConnectionLostr   r   s    r   r#   Echo.writeConnectionLost(   s    #$r   c                 F    [        SU5        [        R                  " 5         g )NconnectionLost)r   r
   stop)r   reasons     r   r&   Echo.connectionLost+   s    'r    N)
__name__
__module____qualname____firstlineno__r   r   r   r#   r&   __static_attributes__r*   r   r   r   r      s    !#(%r   r   )__doc__ossyspathabspathargvfindsepposinsertcurdirzope.interfacer   twisted.internetr   twisted.pythonr   startLoggingstderrr	   r
   r   IHalfCloseableProtocolProtocolr   
StandardIOrunr*   r   r   <module>rD      s    < 
 
ggoochhqk"''(:;"9HHOOArwwsxx{3IcAg>? 299  ' '      6 5 Z../8  0&     r   