
    h!	                         S r SSKJrJr  SSKJrJrJr  SSKJ	r	  SSK
JrJr  SSKJr   " S S\5      r " S	 S
\5      r\" \\5       " S S5      5       rS\\   4S jrS\S\	4S jrg)zT
Plugin-based system for enumerating available reactors and installing one of
them.
    )Iterablecast)	Attribute	Interfaceimplementer)IReactorCore)IPlugin
getPlugins)namedAnyc                   B    \ rS rSrSr\" S5      r\" S5      rSS jrSr	g)	IReactorInstaller   z:
Definition of a reactor which can probably be installed.
zE
    A brief string giving the user-facing name of this reactor.
    zK
    A longer string giving a user-facing description of this reactor.
    Nc                      g)z
Install this reactor.
N r       c/root/1688_scrapy/alibaba-scraper/venv/lib/python3.13/site-packages/twisted/application/reactors.pyinstallIReactorInstaller.install#   s    r   r   returnN)
__name__
__module____qualname____firstlineno____doc__r   	shortNamedescriptionr   __static_attributes__r   r   r   r   r      s.     	I 	Kr   r   c                       \ rS rSrSrSrg)NoSuchReactor,   zL
Raised when an attempt is made to install a reactor which cannot be found.
r   N)r   r   r   r   r   r   r   r   r   r    r    ,   s    r   r    c                   8    \ rS rSrSrS\S\S\4S jrS
S jrS	rg)Reactor2   zp
@ivar moduleName: The fully-qualified Python name of the module of which
the install callable is an attribute.
r   
moduleNamer   c                 (    Xl         X l        X0l        g N)r   r%   r   )selfr   r%   r   s       r   __init__Reactor.__init__9   s    "$&r   Nc                 J    [        U R                  5      R                  5         g r'   )r   r%   r   )r(   s    r   r   Reactor.install>   s    !))+r   )r   r%   r   r   )	r   r   r   r   r   strr)   r   r   r   r   r   r#   r#   2   s&    
'# '3 'S '
,r   r#   r   c                       [        [        5      $ )z5
Return an iterator of L{IReactorInstaller} plugins.
)r
   r   r   r   r   getReactorTypesr/   B   s     '((r   r   c                     [        5        H;  nUR                  U :X  d  M  UR                  5         SSKJn  [        [        U5      s  $    [        U 5      e)z
Install the reactor with the given C{shortName} attribute.

@raise NoSuchReactor: If no reactor is found with a matching C{shortName}.

@raise Exception: Anything that the specified reactor can raise when installed.
r   )reactor)r/   r   r   twisted.internetr1   r   r   r    )r   	installerr1   s      r   installReactorr4   I   sH     %&	)+0g.. ' 	
""r   N)r   typingr   r   zope.interfacer   r   r   twisted.internet.interfacesr   twisted.pluginr	   r
   twisted.python.reflectr   r   KeyErrorr    r#   r/   r-   r4   r   r   r   <module>r;      s|   
 " < < 4 . +	 4H  W'(, , ),)"34 )#c #l #r   