Skip to content

Message

FileEvent

Bases: AttrEnum

File event message type enumerator to use as FileEventMsg type attribute

MOVED = 'MOVED'

DELETED = 'DELETED'

CREATED = 'CREATED'

MODIFIED = 'MODIFIED'

CLOSED = 'CLOSED'

OPENED = 'OPENED'

FileEventMsg

FileEventMsg(type: FileEvent | str, path: Path)

Bases: Msg

Parameters:

  • type (FileEvent | str) –

    File event type

  • path (Path) –

    File path

type

type: FileEvent

File event type

path

path: Path = path

File path of event

matches

matches(
    type: None | Container[FileEvent] | FileEvent | str = None,
    path: None | Container[Path] | Path = None,
) -> bool

Checks if message's attributes match all provided attribute conditions:

  1. If condition is None or omitted, it matches anything.

  2. If condition equals attribute, it matches the attribute.

  3. If condition is a container (list, tuple, range, etc.) and contains the attribute, it matches the attribute.

Use Not(condition) to invert condition matching. Use Glob(pattern) or Regex(pattern) for string pattern matching.

Returns:

  • bool –

    True if all attributes match, False if any does not match