class documentation

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_excluded Return exclude status for specified file.
Method on_modified Report found and available file on the outgoing queue.
Instance Variable excluded_paths Excluded paths in basename form.
Instance Variable out_queue 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
out_queue:QueueSearch response queue.
case_sensitive:boolUse case-sensitive file matching (default is False).
patterns:Optional[list]A list of file patterns to search for.
excluded_paths:Optional[list]A list of excluded paths (in basename form).
ignore_patterns:Optional[list]A list of file patterns to ignore.
def is_excluded(self, current_file: str) -> bool: (source)

Return exclude status for specified file.

Parameters
current_file:strCurrent file.
Returns
boolExclude status.
def on_modified(self, event: FileModifiedEvent): (source)

Report found and available file on the outgoing queue.

Note that a non-excluded file directory is a reporting prerequisite.

Parameters
event:FileModifiedEventReceived event.
excluded_paths: set = (source)

Excluded paths in basename form.

File detection report queue.