
    ʆh                        S SK Jr  S SKrS SKrS SKJr  S SKJr  \(       a  S SKJr  S SK	J
r
  \R                  " \5      r " S S\5      rg)	    )annotationsN)TYPE_CHECKING)
BaseThread)Callable)FileSystemEventc                  `   ^  \ rS rSrSr      SU 4S jjrS	S jrS
U 4S jjrS
S jrSr	U =r
$ )EventDebouncer   a  Background thread for debouncing event handling.

When an event is received, wait until the configured debounce interval
passes before calling the callback.  If additional events are received
before the interval passes, reset the timer and keep waiting.  When the
debouncing interval passes, the callback will be called with a list of
events in the order in which they were received.
c                |   > [         TU ]  5         Xl        X l        / U l        [
        R                  " 5       U l        g N)super__init__debounce_interval_secondsevents_callback_events	threading	Condition_cond)selfr   r   	__class__s      V/opt/services/DDDS/venv/lib/python3.13/site-packages/watchdog/utils/event_debouncer.pyr   EventDebouncer.__init__   s3    
 	)B&..0((*
    c                    U R                      U R                  R                  U5        U R                   R                  5         S S S 5        g ! , (       d  f       g = fr   )r   r   appendnotify)r   events     r   handle_eventEventDebouncer.handle_event'   s5    ZZLL&JJ ZZs   6A
Ac                   > U R                      [        TU ]	  5         U R                   R                  5         S S S 5        g ! , (       d  f       g = fr   )r   r   stopr   )r   r   s    r   r!   EventDebouncer.stop,   s-    ZZGLNJJ ZZs   )A  
Ac                   U R                       U R                   R                  5         U R                  (       aU  U R                  5       (       a@  U R                   R                  U R                  S9(       d  OU R                  5       (       a  M@  U R                  5       (       d  O&U R                  n/ U l        U R                  U5        M  S S S 5        g ! , (       d  f       g = f)N)timeout)r   waitr   should_keep_runningr   r   )r   eventss     r   runEventDebouncer.run1   s    ZZ

!112244#zzt7U7UV! 2244 //11!$$V,  ZZs   B C<C
C")r   r   r   r   )r   intr   z'Callable[[list[FileSystemEvent]], None]returnNone)r   r   r+   r,   )r+   r,   )__name__
__module____qualname____firstlineno____doc__r   r   r!   r(   __static_attributes____classcell__)r   s   @r   r	   r	      s>    
+#&
+ A
+ 
	
+ 
 
- -r   r	   )
__future__r   loggingr   typingr   watchdog.utilsr   r   watchdog.eventsr   	getLoggerr-   loggerr	    r   r   <module>r<      s9    "     %/			8	$1-Z 1-r   