sdkagent

watchdog API reference

60 public APIs from watchdog (gorakhargosh/watchdog) — 23 classes, 11 functions, 26 methods. Signatures extracted by static analysis of the actual source.

Repository: gorakhargosh/watchdog

KindCount
Classes23
Functions11
Methods26

API list

classsrc.watchdog.events.LoggingEventHandler
Logs all the events captured.
classsrc.watchdog.observers.api.BaseObserver
Base observer.
methodsrc.watchdog.observers.api.BaseObserver.add_handler_for_watch(event_handler:FileSystemEventHandler, watch:ObservedWatch) -> None
Adds a handler for the given watch.
methodsrc.watchdog.observers.api.BaseObserver.emitters() -> set[EventEmitter]
Returns event emitter created by this observer.
methodsrc.watchdog.observers.api.BaseObserver.remove_handler_for_watch(event_handler:FileSystemEventHandler, watch:ObservedWatch) -> None
Removes a handler for the given watch.
methodsrc.watchdog.observers.api.BaseObserver.unschedule(watch:ObservedWatch) -> None
Unschedules a watch.
methodsrc.watchdog.observers.api.EventDispatcher.timeout() -> float
Timeout value to construct emitters with.
methodsrc.watchdog.observers.api.EventEmitter.queue_event(event:FileSystemEvent) -> None
Queues a single event.
methodsrc.watchdog.observers.api.EventEmitter.timeout() -> float
Blocking timeout for reading events.
methodsrc.watchdog.observers.api.EventEmitter.watch() -> ObservedWatch
The watch associated with this emitter.
classsrc.watchdog.observers.api.ObservedWatch
An scheduled watch.
methodsrc.watchdog.observers.api.ObservedWatch.follow_symlink() -> bool
Determines whether symlink are followed.
methodsrc.watchdog.observers.api.ObservedWatch.path() -> str
The path that this watch monitors.
classsrc.watchdog.observers.fsevents.FSEventsEmitter
macOS FSEvents Emitter class.
classsrc.watchdog.observers.fsevents2.FSEventsEmitter
FSEvents based event emitter.
classsrc.watchdog.observers.fsevents2.FSEventsQueue
Low level FSEvents client.
classsrc.watchdog.observers.inotify.InotifyEmitter
inotify(7)-based event emitter.
classsrc.watchdog.observers.inotify.InotifyFullEmitter
inotify(7)-based event emitter.
classsrc.watchdog.observers.inotify.InotifyWatchGroup
Linux inotify(7) API wrapper class.
methodsrc.watchdog.observers.inotify.InotifyWatchGroup.deactivate() -> None
Removes all associated watches.
methodsrc.watchdog.observers.inotify.InotifyWatchGroup.is_active() -> bool
Returns True if there are any callbacks active
classsrc.watchdog.observers.inotify_c.InotifyEvent
Inotify event struct wrapper.
classsrc.watchdog.observers.inotify_c.InotifyFD
Linux inotify(7) API wrapper class.
methodsrc.watchdog.observers.inotify_c.InotifyFD.read_events(*event_buffer_size:int=DEFAULT_EVENT_BUFFER_SIZE) -> list[InotifyEvent]
Reads events from inotify and yields them.
methodsrc.watchdog.observers.inotify_c.InotifyFD.remove_callbacks(callbacks:list[tuple[WatchDescriptor, CallbackId]]) -> None
Removes callbacks from WatchDescriptors.
methodsrc.watchdog.observers.inotify_c.InotifyFD.run() -> None
Read events from `inotify` and handle them.
classsrc.watchdog.observers.inotify_c.Watch
Represents an inotify watch
classsrc.watchdog.observers.inotify_move_event_grouper.PathedInotifyEvent
An InotifyEvent and its full source path
classsrc.watchdog.observers.kqueue.KeventDescriptorSet
Thread-safe kevent descriptor collection.
methodsrc.watchdog.observers.kqueue.KeventDescriptorSet.clear() -> None
Clears the collection and closes all open descriptors.
methodsrc.watchdog.observers.kqueue.KeventDescriptorSet.kevents() -> list[select.kevent]
List of kevents monitored.
classsrc.watchdog.observers.kqueue.KqueueEmitter
kqueue(2)-based event emitter.
methodsrc.watchdog.observers.kqueue.KqueueEmitter.queue_event(event:FileSystemEvent) -> None
Handles queueing a single event object.
funcsrc.watchdog.observers.kqueue.is_deleted(kev:select.kevent) -> bool
Determines whether the given kevent represents deletion.
funcsrc.watchdog.observers.kqueue.is_modified(kev:select.kevent) -> bool
Determines whether the given kevent represents modification.
funcsrc.watchdog.observers.kqueue.is_renamed(kev:select.kevent) -> bool
Determines whether the given kevent represents movement.
classsrc.watchdog.tricks.LoggerTrick
A simple trick that does only logs events.
classsrc.watchdog.tricks.ShellCommandTrick
Executes shell commands in response to matched events.
classsrc.watchdog.tricks.Trick
Your tricks should subclass this class.
classsrc.watchdog.utils.BaseThread
Convenience class for creating stoppable threads.
methodsrc.watchdog.utils.BaseThread.on_thread_start() -> None
Override this method instead of :meth:`start()`.
methodsrc.watchdog.utils.BaseThread.on_thread_stop() -> None
Override this method instead of :meth:`stop()`.
methodsrc.watchdog.utils.BaseThread.should_keep_running() -> bool
Determines whether the thread should continue running.
methodsrc.watchdog.utils.BaseThread.stop() -> None
Signals the thread to stop.
classsrc.watchdog.utils.dirsnapshot.DirectorySnapshot
A snapshot of stat information of files in a directory.
methodsrc.watchdog.utils.dirsnapshot.DirectorySnapshot.inode(path:bytes | str) -> tuple[int, int]
Returns an id for path.
methodsrc.watchdog.utils.dirsnapshot.DirectorySnapshot.path(uid:tuple[int, int]) -> bytes | str | None
Returns path for id.
methodsrc.watchdog.utils.dirsnapshot.DirectorySnapshot.paths() -> set[bytes | str]
Set of file/directory paths in the snapshot.
classsrc.watchdog.utils.dirsnapshot.EmptyDirectorySnapshot
Class to implement an empty snapshot.
methodsrc.watchdog.utils.dirsnapshot.EmptyDirectorySnapshot.path(_:Any) -> None
Mock up method to return the path of the received inode.
funcsrc.watchdog.utils.echo.echo(fn:Callable, write:Callable[[str], int | None]=sys.stdout.write) -> Callable
Echo calls to a function.
funcsrc.watchdog.utils.echo.format_arg_value(arg_val:tuple[str, tuple[Any, ...]]) -> str
Return a string representing a (name, value) pair.
classsrc.watchdog.utils.event_debouncer.EventDebouncer
Background thread for debouncing event handling.
funcsrc.watchdog.utils.load_module(module_name:str) -> ModuleType
Imports a module given its name and returns a handle to it.
classsrc.watchdog.watchmedo.HelpFormatter
A nicer help formatter.
funcsrc.watchdog.watchmedo.add_to_sys_path(pathnames:list[str], *index:int=0) -> None
Adds specified paths at specified index into the sys.path list.
funcsrc.watchdog.watchmedo.load_config(tricks_file_pathname:str) -> dict
Loads the YAML configuration from the specified file.
funcsrc.watchdog.watchmedo.log(args:Namespace) -> None
Command to log file system events to the console.
funcsrc.watchdog.watchmedo.main() -> int
Entry-point function.
funcsrc.watchdog.watchmedo.tricks_from(args:Namespace) -> None
Command to execute tricks from a tricks configuration file.

About this data

These signatures were extracted from the public source of gorakhargosh/watchdog using Python's ast module. Argument names, default values, type annotations and return types are taken verbatim from the code. Implementation bodies are never stored. See how it works for details.

Back to all 805 libraries