
    \d!	                         d Z ddlmZmZ ddlmZmZmZ ddlm	Z	 ddl
mZmZ ddlmZ  G d de          Z G d	 d
e          Z eee           G d d                      Zdee         fdZdede	fdZdS )zT
Plugin-based system for enumerating available reactors and installing one of
them.
    )Iterablecast)	Attribute	Interfaceimplementer)IReactorCore)IPlugin
getPlugins)namedAnyc                   F    e Zd ZdZ ed          Z ed          ZddZdS )IReactorInstallerzB
    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.
    returnNc                      dS )z'
        Install this reactor.
        N r       <lib/python3.11/site-packages/twisted/application/reactors.pyinstallzIReactorInstaller.install#   s      r   r   N)__name__
__module____qualname____doc__r   	shortNamedescriptionr   r   r   r   r   r      sb          		 I )	 K     r   r   c                       e Zd ZdZdS )NoSuchReactorzT
    Raised when an attempt is made to install a reactor which cannot be found.
    N)r   r   r   r   r   r   r   r   r   ,   s           r   r   c                   .    e Zd ZdZdededefdZd	dZdS )
Reactorz|
    @ivar moduleName: The fully-qualified Python name of the module of which
    the install callable is an attribute.
    r   
moduleNamer   c                 0    || _         || _        || _        d S N)r   r   r   )selfr   r   r   s       r   __init__zReactor.__init__9   s    "$&r   r   Nc                 R    t          | j                                                   d S r!   )r   r   r   )r"   s    r   r   zReactor.install>   s$    !!))+++++r   r   )r   r   r   r   strr#   r   r   r   r   r   r   2   s[         
'# '3 'S ' ' ' '
, , , , , ,r   r   r   c                  *    t          t                    S )z=
    Return an iterator of L{IReactorInstaller} plugins.
    )r
   r   r   r   r   getReactorTypesr'   B   s     '(((r   r   c                     t                      D ]>}|j        | k    r1|                                 ddlm} t          t          |          c S ?t          |           )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.internetr)   r   r   r   )r   	installerr)   s      r   installReactorr,   I   sv     %&& / /	)++00000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%   r,   r   r   r   <module>r3      sf  
  " ! ! ! ! ! ! ! < < < < < < < < < < 4 4 4 4 4 4 . . . . . . . . + + + + + +    	   4    H    W'((, , , , , , , )(,)"34 ) ) ) )#c #l # # # # # #r   