o
    h                     @  sz   d Z ddlmZ ddlZddlZddlmZmZ ddlm	Z	m
Z
 er(ddlmZ G dd deZdd
dZe ZdgZdS )u  :module: watchdog.observers
:synopsis: Observer that picks a native implementation if available.
:author: yesudeep@google.com (Yesudeep Mangalapilly)
:author: contact@tiger-222.fr (Mickaël Schoentgen)

Classes
=======
.. autoclass:: Observer
   :members:
   :show-inheritance:
   :inherited-members:

Observer thread that schedules watching directories and dispatches
calls to event handlers.

You can also import platform specific classes directly and use it instead
of :class:`Observer`.  Here is a list of implemented observer classes.:

============== ================================ ==============================
Class          Platforms                        Note
============== ================================ ==============================
|Inotify|      Linux 2.6.13+                    ``inotify(7)`` based observer
|FSEvents|     macOS                            FSEvents based observer
|Kqueue|       macOS and BSD with kqueue(2)     ``kqueue(2)`` based observer
|WinApi|       Microsoft Windows                Windows API-based observer
|Polling|      Any                              fallback implementation
============== ================================ ==============================

.. |Inotify|     replace:: :class:`.inotify.InotifyObserver`
.. |FSEvents|    replace:: :class:`.fsevents.FSEventsObserver`
.. |Kqueue|      replace:: :class:`.kqueue.KqueueObserver`
.. |WinApi|      replace:: :class:`.read_directory_changes.WindowsApiObserver`
.. |Polling|     replace:: :class:`.polling.PollingObserver`

    )annotationsN)TYPE_CHECKINGProtocol)UnsupportedLibcErrorplatform)BaseObserverc                   @  s   e Zd Zddd
ddZd	S )ObserverType.)timeoutr	   floatreturnr   c                C  s   d S )N )selfr	   r   r   O/var/www/vscode/kcb/lib/python3.10/site-packages/watchdog/observers/__init__.py__call__2   s    zObserverType.__call__N)r	   r
   r   r   )__name__
__module____qualname__r   r   r   r   r   r   1   s    r   r   c                  C  s  t  r"tt ddlm}  | W  d    S 1 sw   Y  net  r]z	ddlm	} W |S  t
y\   zddlm} W n t
yN   tjddd Y nw tjddd | Y S Y n+w t  r{z	dd	lm} W |S  t
yz   tjd
dd Y nw t  rddlm} |S ddlm} |S )Nr   )InotifyObserver)FSEventsObserver)KqueueObserverz;Failed to import fsevents and kqueue. Fall back to polling.   )
stacklevelz.Failed to import fsevents. Fall back to kqueue)WindowsApiObserverz@Failed to import `read_directory_changes`. Fall back to polling.)PollingObserver)r   is_linux
contextlibsuppressr   watchdog.observers.inotifyr   	is_darwinwatchdog.observers.fseventsr   	Exceptionwatchdog.observers.kqueuer   warningswarn
is_windows)watchdog.observers.read_directory_changesr   is_bsdwatchdog.observers.pollingr   )r   r   r   r   r   r   r   r   _get_observer_cls5   s>   "

r(   Observer)r   r   )__doc__
__future__r   r   r"   typingr   r   watchdog.utilsr   r   watchdog.observers.apir   r   r(   r)   __all__r   r   r   r   <module>   s    $
$
