| module: | watchdog.events |
|---|---|
| synopsis: | File system events and event handlers. |
| author: | Gora Khargosh <gora.khargosh@gmail.com> |
Bases: object
Immutable type that represents a file system event that is triggered when a change occurs on the monitored file system.
All FileSystemEvent objects are required to be immutable and hence can be used as keys in dictionaries or be added to sets.
Bases: watchdog.events.FileSystemEvent
File system event representing any kind of file system movement.
Bases: watchdog.events.FileSystemMovedEvent
File system event representing file movement on the file system.
Bases: watchdog.events.FileSystemMovedEvent
File system event representing directory movement on the file system.
Generates moved events for file sytem objects within the moved directory.
| Parameters: |
|
|---|---|
| Returns: | iterable of event objects of type FileMovedEvent and DirMovedEvent. |
Bases: watchdog.events.FileSystemEvent
File system event representing file modification on the file system.
Bases: watchdog.events.FileSystemEvent
File system event representing directory modification on the file system.
Bases: watchdog.events.FileSystemEvent
File system event representing file creation on the file system.
Bases: watchdog.events.FileSystemEvent
File system event representing directory creation on the file system.
Bases: watchdog.events.FileSystemEvent
File system event representing file deletion on the file system.
Bases: watchdog.events.FileSystemEvent
File system event representing directory deletion on the file system.
Bases: object
Base file system event handler that you can override methods from.
Dispatches events to the appropriate methods.
| Parameters: |
|
|---|
Catch-all event handler.
| Parameters: |
|
|---|
Called when a file or directory is created.
| Parameters: |
|
|---|
Called when a file or directory is deleted.
| Parameters: |
|
|---|
Called when a file or directory is modified.
| Parameters: |
|
|---|
Called when a file or a directory is moved or renamed.
| Parameters: |
|
|---|
Bases: watchdog.events.FileSystemEventHandler
Matches given patterns with file paths associated with occurring events.
(Read-only) True if path names should be matched sensitive to case; False otherwise.
Dispatches events to the appropriate methods.
| Parameters: |
|
|---|
Bases: watchdog.events.FileSystemEventHandler
Logs all the events captured.
| module: | watchdog.observers.api |
|---|---|
| synopsis: | Classes useful to observer implementers. |
| author: | Gora Khargosh <gora.khargosh@gmail.com> |
Bases: brownie.datastructures.queues.SetQueue
Thread-safe event queue based on a thread-safe ordered-set queue to ensure duplicate FileSystemEvent objects are prevented from adding themselves to the queue to avoid dispatching multiple event handling calls when multiple identical events are produced quicker than an observer can consume them.
Bases: watchdog.utils.DaemonThread
Producer daemon thread base class subclassed by event emitters that generate events and populate a queue with them.
| Parameters: |
|
|---|
Override this method for cleaning up immediately before the daemon thread stops completely.
Queues a single event.
| Parameters: |
|
|---|
Bases: watchdog.utils.DaemonThread
Consumer daemon thread base class subclassed by event observer threads that dispatch events from an event queue to appropriate event handlers.
| Parameters: |
|
|---|
Override this method to dispatch an individual event.
| Parameters: |
|
|---|
The event queue which is populated with file system events by emitters and from which events are dispatched by a dispatcher thread.
Bases: watchdog.observers.api.EventDispatcher
Base observer.
Adds a handler for the given watch.
| Parameters: |
|
|---|
Removes a handler for the given watch.
| Parameters: |
|
|---|
Schedules watching a path and calls appropriate methods specified in the given event handler in response to file system events.
| Parameters: |
|
|---|---|
| Returns: | An ObservedWatch object instance representing a watch. |
Unschedules a watch.
| Parameters: |
|
|---|
| module: | watchdog.observers |
|---|---|
| synopsis: | Observer that picks a native implementation if available. |
| author: | Gora Khargosh <gora.khargosh@gmail.com> |
Bases: watchdog.observers.kqueue.KqueueObserver
Observer thread that schedules watching directories and dispatches calls to event handlers.
Adds a handler for the given watch.
| Parameters: |
|
|---|
The event queue which is populated with file system events by emitters and from which events are dispatched by a dispatcher thread.
Override this method instead of stop(). stop() calls this method.
Note that this method is called immediately after the daemon thread is signaled to halt.
Removes a handler for the given watch.
| Parameters: |
|
|---|
Schedules watching a path and calls appropriate methods specified in the given event handler in response to file system events.
| Parameters: |
|
|---|---|
| Returns: | An ObservedWatch object instance representing a watch. |
Determines whether the daemon thread should continue running.
Determines whether the daemon thread should stop.
Signals the daemon thread to stop.
Event queue block timeout.
Unschedules a watch.
| Parameters: |
|
|---|
Unschedules all watches and detaches all associated event handlers.
| module: | watchdog.utils |
|---|---|
| synopsis: | Utility classes and functions. |
| author: | Gora Khargosh <gora.khargosh@gmail.com> |
hasattr() swallows exceptions. has_attribute() tests a Python object for the presence of an attribute.
| Parameters: |
|
|---|
Loads and returns a class definition provided a dotted path specification the last part of the dotted path is the class name and there is at least one module name preceding the class name.
Notes: You will need to ensure that the module you are trying to load exists in the Python path.
Examples: - module.name.ClassName # Provided module.name is in the Python path. - module.ClassName # Provided module is in the Python path.
What won’t work: - ClassName - modle.name.ClassName # Typo in module name. - module.name.ClasNam # Typo in classname.
Bases: threading.Thread
Daemon thread convenience class, sets a few properties and makes writing daemon threads a little easier.
| module: | watchdog.utils.dirsnapshot |
|---|---|
| synopsis: | Directory snapshots and comparison. |
| author: | Gora Khargosh <gora.khargosh@gmail.com> |
Where are the moved events? They “disappeared”
This implementation does not take partition boundaries into consideration. It will only work when the directory tree is entirely on the same file system. More specifically, any part of the code that depends on inode numbers can break if partition boundaries are crossed. In these cases, the snapshot diff will represent file/directory movement as created and deleted events.
Windows does not have any concept of inodes, which prevents this snapshotter from determining file or directory renames/movement on it. The snapshotter does not try to handle this on Windows. File or directory movement will show up as creation and deletion events.
Please do not use this on a virtual file system mapped to a network share.
Bases: object
A snapshot of stat information of files in a directory.
| Parameters: |
|
|---|
Determines the path that an inode represents in a snapshot.
| Parameters: |
|
|---|
Returns a stat information object for the specified path from the snapshot.
| Parameters: |
|
|---|
Bases: object
Compares two directory snapshots and creates an object that represents the difference between the two snapshots.
| Parameters: |
|
|---|