class documentation
class FileModifiedEventHandler(PatternMatchingEventHandler): (source)
Constructor: FileModifiedEventHandler(out_queue, case_sensitive, patterns, excluded_paths, ignore_patterns)
Put a JSON message on the out_queue when a file is detected and available.
A list of normal search file pattern(s) can be supplied (when no pattern is given, the Default value is ['*'], meaning all files).
A list of ignored search file pattern(s) can be supplied.
A list of excluded search path(s) in basename form can be supplied (note that this only makes sense when the search is recursive, and this flag is set in the Observer scheduling part of the job, in another module).
- Structure of a reported message:
- {"msgType": "FileFound", "file": "<filename-with-path>"}
| Method | __init__ |
The class constructor. |
| Method | is |
Return exclude status for specified file. |
| Method | on |
Report found and available file on the outgoing queue. |
| Instance Variable | excluded |
Excluded paths in basename form. |
| Instance Variable | out |
File detection report queue. |
def __init__(self, out_queue:
Queue, case_sensitive: bool = False, patterns: Optional[ list] = None, excluded_paths: Optional[ list] = None, ignore_patterns: Optional[ list] = None):
(source)
¶
The class constructor.
| Parameters | |
outQueue | Search response queue. |
casebool | Use case-sensitive file matching (default is False). |
patterns:Optional[ | A list of file patterns to search for. |
excludedOptional[ | A list of excluded paths (in basename form). |
ignoreOptional[ | A list of file patterns to ignore. |