3
=Ad]  ã               @   s6   d Z ddlZddlmZ ejeƒZG dd„ deƒZdS )zÓ A non-GUI application with a twisted reactor event loop.

Nothing is imported from twisted until the application is started so this
module can safely live in the Envisage core without twisted being installed.

é    N)ÚApplicationc                   s,   e Zd ZdZ‡ fdd„Z‡ fdd„Z‡  ZS )ÚTwistedApplicationz: A non-GUI application with a twisted reactor event loop. c                s4   t t| ƒjƒ }|r0ddlm} tjdƒ |jƒ  |S )z Start the application. r   )Úreactorz&---------- reactor starting ----------)Úsuperr   ÚstartÚtwisted.internetr   ÚloggerÚdebugÚrun)ÚselfÚstartedr   )Ú	__class__© úx/home/yuhw/wc/wire-cell-python/wcpy/lib/python3.6/site-packages/envisage-4.7.2-py3.6.egg/envisage/twisted_application.pyr      s    
zTwistedApplication.startc                s4   t t| ƒjƒ }|r0ddlm} tjdƒ |jƒ  |S )z Stop the application. r   )r   z&---------- reactor stopping ----------)r   r   Ústopr   r   r   r	   )r   Ústoppedr   )r   r   r   r   %   s    
zTwistedApplication.stop)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   Ú__classcell__r   r   )r   r   r      s   r   )r   ÚloggingZenvisage.apir   Ú	getLoggerr   r   r   r   r   r   r   Ú<module>   s   
