a
    §ˆc  ã                   @   s`   d Z ddlmZ ddlmZmZ edƒZG dd„ deeƒZG dd„ deeƒZG d	d
„ d
eƒZ	dS )a+  
Event-loop based timers that perform actions periodically.

Note that if a timer goes out of scope without a reference to being saved,
there is nothing keeping the underlying toolkit timer alive and it will be
garbage collected, meaning that the timer will stop firing (or indeed, may
never fire).
é    )Útoolkit_object)ÚMCallbackTimerÚMEventTimerztimer.timer:PyfaceTimerc                   @   s   e Zd ZdS )Ú
EventTimerN©Ú__name__Ú
__module__Ú__qualname__© r
   r
   úU/home/yuhw/wc/wire-cell-python/wcpy/lib/python3.9/site-packages/pyface/timer/timer.pyr      s   r   c                   @   s   e Zd ZdS )ÚCallbackTimerNr   r
   r
   r
   r   r      s   r   c                       sB   e Zd ZdZ‡ fdd„Zdd„ Zddd„Zd	d
„ Zdd„ Z‡  Z	S )ÚTimerz4 Subclass of CallbackTimer that matches the old API c                    s(   |d }t ƒ j||||d� |  ¡  dS )z» Initialize and start the timer.

        Initialize instance to invoke the given `callable` with given
        arguments and keyword args after every `millisecs` (milliseconds).
        ç     @�@)ÚintervalÚcallbackÚargsÚkwargsN)ÚsuperÚ__init__Ústart)ÚselfÚ	millisecsÚcallabler   r   r   ©Ú	__class__r
   r   r   $   s
    ÿzTimer.__init__c                 C   s   |   ¡  dS )z/ Alias for `perform` to match old API.
        N)Zperform©r   r
   r
   r   ÚNotify0   s    zTimer.NotifyNc                 C   s   |dur|d | _ |  ¡  dS )z- Alias for `start` to match old API.
        Nr   )r   r   )r   r   r
   r
   r   ÚStart5   s    
zTimer.Startc                 C   s   |   ¡  dS )z, Alias for `stop` to match old API.
        N)Ústopr   r
   r
   r   ÚStop=   s    z
Timer.Stopc                 C   s   | j S )z9 Alias for is_running property to match old API.
        )Ú_activer   r
   r
   r   Ú	IsRunningB   s    zTimer.IsRunning)N)
r   r   r	   Ú__doc__r   r   r   r   r!   Ú__classcell__r
   r
   r   r   r   !   s   
r   N)
r"   Zpyface.toolkitr   Zpyface.timer.i_timerr   r   ZPyfaceTimerr   r   r   r
   r
   r
   r   Ú<module>
   s   	