a
    ©ˆca  ã                   @   s4   d Z ddlmZmZ ddlmZ G dd„ deƒZdS )a[   This module provides a plugin which adds an EventManager to application.

If the application does not already have an evt_mgr attribute which is an
instance of EventManager, the plugin creates a new EventManager instance,
creates a service to offer the event manager and sets the evt_mgr instance
of the application to the created event manager.
é    )ÚPluginÚServiceOffer)ÚListc                   @   s*   e Zd ZdZdZdZeed�Zdd„ ZdS )ÚEventManagerPluginz1 Plugin to add event manager to the application. zenvisage.event_managerzenvisage.service_offers)Zcontributes_toc                 C   s"   ddl m}m} t||d�}|gS )Nr   )ÚBaseEventManagerÚget_event_manager)ÚprotocolÚfactory)Zencore.events.apir   r   r   )Úselfr   r   Zevt_mgr_service_offer© r   úh/home/yuhw/wc/wire-cell-python/wcpy/lib/python3.9/site-packages/envisage/plugins/event_manager/plugin.pyÚ_service_offers_default   s
    ÿz*EventManagerPlugin._service_offers_defaultN)	Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚidZSERVICE_OFFERSr   Zservice_offersr   r   r   r   r   r      s
   
r   N)r   Zenvisage.apir   r   Z
traits.apir   r   r   r   r   r   Ú<module>
   s   	