o
    ¯b  ã                   @   sÔ   d Z ddlmZ ddlmZmZmZmZ ddlm	Z	 ee	ƒG dd„ dƒƒZ
eeƒG dd„ de
ƒƒZeeƒG d	d
„ d
e
ƒƒZG dd„ dƒZeeƒG dd„ deƒƒZeeƒG dd„ deƒƒZedƒZedƒZedƒZdS )zM
Fake client and server endpoint string parser plugins for testing purposes.
é    )Úimplementer)ÚIStreamClientEndpointÚ,IStreamClientEndpointStringParserWithReactorÚIStreamServerEndpointÚ!IStreamServerEndpointStringParser)ÚIPluginc                   @   ó   e Zd Zdd„ ZdS )Ú
PluginBasec                 C   s
   || _ d S ©N)Úprefix)ÚselfÚpfx© r   úD/usr/lib/python3/dist-packages/twisted/internet/test/fakeendpoint.pyÚ__init__   s   
zPluginBase.__init__N©Ú__name__Ú
__module__Ú__qualname__r   r   r   r   r   r	      ó    r	   c                   @   r   )ÚFakeClientParserWithReactorc                 O   ó   t | ||ƒS r
   )ÚStreamClient©r   ÚaÚkwr   r   r   ÚparseStreamClient   ó   z-FakeClientParserWithReactor.parseStreamClientN)r   r   r   r   r   r   r   r   r      r   r   c                   @   r   )Ú
FakeParserc                 O   r   r
   )ÚStreamServerr   r   r   r   ÚparseStreamServer#   r   zFakeParser.parseStreamServerN)r   r   r   r    r   r   r   r   r   !   r   r   c                   @   r   )ÚEndpointBasec                 C   s   || _ || _|| _d S r
   )ÚparserÚargsÚkwargs)r   r"   r#   r$   r   r   r   r   (   s   
zEndpointBase.__init__Nr   r   r   r   r   r!   '   s    r!   c                   @   ó   e Zd Zddd„ZdS )r   Nc                 C   ó   d S r
   r   ©r   ÚprotocolFactoryr   r   r   Úconnect0   ó   zStreamClient.connectr
   )r   r   r   r)   r   r   r   r   r   .   ó    r   c                   @   r%   )r   Nc                 C   r&   r
   r   r'   r   r   r   Úlisten7   r*   zStreamServer.listenr
   )r   r   r   r,   r   r   r   r   r   5   r+   r   ÚfakeÚcrfakeÚcpfakeN)Ú__doc__Úzope.interface.declarationsr   Útwisted.internet.interfacesr   r   r   r   Útwisted.pluginr   r	   r   r   r!   r   r   r-   ÚfakeClientWithReactorÚ"fakeClientWithReactorAndPreferencer   r   r   r   Ú<module>   s$   