ó
[³XMc           @   s    d  Z  d d l m Z m Z m Z d d l m Z m Z d d l m	 Z	 d e f d „  ƒ  YZ
 d e f d „  ƒ  YZ d	 e f d
 „  ƒ  YZ d „  Z d „  Z d S(   sT   
Plugin-based system for enumerating available reactors and installing one of
them.
iÿÿÿÿ(   t	   Interfacet	   Attributet
   implements(   t   IPlugint
   getPlugins(   t   namedAnyt   IReactorInstallerc           B   s/   e  Z d  Z e d ƒ Z e d ƒ Z d „  Z RS(   sB   
    Definition of a reactor which can probably be installed.
    sE   
    A brief string giving the user-facing name of this reactor.
    sK   
    A longer string giving a user-facing description of this reactor.
    c           C   s   d S(   s'   
        Install this reactor.
        N(    (    (    (    s@   /usr/lib/python2.7/dist-packages/twisted/application/reactors.pyt   install   s    (   t   __name__t
   __module__t   __doc__R   t	   shortNamet   descriptionR   (    (    (    s@   /usr/lib/python2.7/dist-packages/twisted/application/reactors.pyR      s   		t   NoSuchReactorc           B   s   e  Z d  Z RS(   sT   
    Raised when an attempt is made to install a reactor which cannot be found.
    (   R   R	   R
   (    (    (    s@   /usr/lib/python2.7/dist-packages/twisted/application/reactors.pyR   &   s   t   Reactorc           B   s-   e  Z d  Z e e e ƒ d „  Z d „  Z RS(   s|   
    @ivar moduleName: The fully-qualified Python name of the module of which
    the install callable is an attribute.
    c         C   s   | |  _  | |  _ | |  _ d  S(   N(   R   t
   moduleNameR   (   t   selfR   R   R   (    (    s@   /usr/lib/python2.7/dist-packages/twisted/application/reactors.pyt   __init__4   s    		c         C   s   t  |  j ƒ j ƒ  d  S(   N(   R   R   R   (   R   (    (    s@   /usr/lib/python2.7/dist-packages/twisted/application/reactors.pyR   :   s    (   R   R	   R
   R   R   R   R   R   (    (    (    s@   /usr/lib/python2.7/dist-packages/twisted/application/reactors.pyR   ,   s   	c           C   s
   t  t ƒ S(   s=   
    Return an iterator of L{IReactorInstaller} plugins.
    (   R   R   (    (    (    s@   /usr/lib/python2.7/dist-packages/twisted/application/reactors.pyt   getReactorTypes?   s    c         C   s=   x* t  ƒ  D] } | j |  k r
 | j ƒ  Sq
 Wt |  ƒ ‚ d S(   sß   
    Install the reactor with the given C{shortName} attribute.

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

    @raise: anything that the specified reactor can raise when installed.
    N(   R   R   R   R   (   R   t	   installer(    (    s@   /usr/lib/python2.7/dist-packages/twisted/application/reactors.pyt   installReactorG   s    N(   R
   t   zope.interfaceR    R   R   t   twisted.pluginR   R   t   twisted.python.reflectR   R   t   KeyErrorR   t   objectR   R   R   (    (    (    s@   /usr/lib/python2.7/dist-packages/twisted/application/reactors.pyt   <module>   s   	