K iddlmZddlZddlZddlmZddlmZer ddlmZddl m Z eje Z GddeZy) ) annotationsN) TYPE_CHECKING) BaseThread)Callable)FileSystemEventcLeZdZdZ dfd ZddZdfd ZddZxZS) EventDebounceraBackground 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|||_||_g|_t j |_yN)super__init__debounce_interval_secondsevents_callback_events threading Condition_cond)selfrr __class__s d/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/watchdog/utils/event_debouncer.pyr zEventDebouncer.__init__s7 )B&..0 ((* c|j5|jj||jjdddy#1swYyxYwr )rrappendnotify)revents r handle_eventzEventDebouncer.handle_event's@ ZZ LL   & JJ      s 6A  Ac|j5t| |jjdddy#1swYyxYwr )rr stopr)rrs rrzEventDebouncer.stop,s8 ZZ GLN JJ      s )AA c|j5 |jj|jrH|jr8|jj|jsn|jr8|jsn%|j}g|_|j | dddy#1swYyxYw)N)timeout)rwaitrshould_keep_runningrr)reventss rrunzEventDebouncer.run1s ZZ - !11224#zzt7U7UV!224//1! $$V, - - -sA/B==6B==C)rintrz'Callable[[list[FileSystemEvent]], None]returnNone)rrr&r')r&r') __name__ __module__ __qualname____doc__r rrr$ __classcell__)rs@rr r s9 +#& +A +  +  -rr ) __future__rloggingrtypingrwatchdog.utilsrrwatchdog.eventsr getLoggerr(loggerr rrr5s;" %/   8 $1-Z1-r