o ¯b! ã@s°dZddlmZmZddlmZmZmZddlm Z ddl m Z m Z ddl mZGdd„deƒZGd d „d eƒZee eƒGd d „d ƒƒZd eefdd„Zded e fdd„ZdS)zT Plugin-based system for enumerating available reactors and installing one of them. é)ÚIterableÚcast)Ú AttributeÚ InterfaceÚ implementer)Ú IReactorCore)ÚIPluginÚ getPlugins)ÚnamedAnyc@s*eZdZdZedƒZedƒZddd„ZdS) Ú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. ÚreturnNcCsdS)z' Install this reactor. N©r r r ú>/usr/lib/python3/dist-packages/twisted/application/reactors.pyÚinstall#szIReactorInstaller.install©r N)Ú__name__Ú __module__Ú __qualname__Ú__doc__rÚ shortNameÚ descriptionrr r r rr sÿÿr c@seZdZdZdS)Ú NoSuchReactorzT Raised when an attempt is made to install a reactor which cannot be found. N)rrrrr r r rr,src@s0eZdZdZdededefdd„Zd d d „ZdS) ÚReactorz| @ivar moduleName: The fully-qualified Python name of the module of which the install callable is an attribute. rÚ moduleNamercCs||_||_||_dS©N)rrr)Úselfrrrr r rÚ__init__9s zReactor.__init__r NcCst|jƒ ¡dSr)r rr)rr r rr>szReactor.installr)rrrrÚstrrrr r r rr2srr cCsttƒS)z= Return an iterator of L{IReactorInstaller} plugins. )r r r r r rÚgetReactorTypesBsrrcCs@tƒD]}|j|kr| ¡ddlm}tt|ƒSqt|ƒ‚)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)rrrÚtwisted.internetrrrr)rÚ installerrr r rÚinstallReactorIs   ür"N)rÚtypingrrÚzope.interfacerrrÚtwisted.internet.interfacesrÚtwisted.pluginrr Útwisted.python.reflectr r ÚKeyErrorrrrrr"r r r rÚs