
    Vh!	                         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y)zT
Plugin-based system for enumerating available reactors and installing one of
them.
    )Iterablecast)	Attribute	Interfaceimplementer)IReactorCore)IPlugin
getPlugins)namedAnyc                   8    e Zd ZdZ ed      Z ed      ZddZy)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.
    Nc                       y)z'
        Install this reactor.
        N r       L/home/dcms/DCMS/lib/python3.12/site-packages/twisted/application/reactors.pyinstallzIReactorInstaller.install#   s    r   returnN)__name__
__module____qualname____doc__r   	shortNamedescriptionr   r   r   r   r   r      s.     	I 	Kr   r   c                       e Zd ZdZy)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y)	Reactorz|
    @ivar moduleName: The fully-qualified Python name of the module of which
    the install callable is an attribute.
    r   
moduleNamer   c                 .    || _         || _        || _        y N)r   r   r   )selfr   r   r   s       r   __init__zReactor.__init__9   s    "$&r   Nc                 J    t        | j                        j                          y 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 ]9  }|j                  | k(  s|j                          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   sM     %& /	)+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      s|   
 " < < 4 . +	 4H  W'(, , ),)"34 )#c #l #r   