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: pathlib.Path,
    *,
    source: None | FileEventIn = None
)

Bases: Msg

Parameters:

  • type (FileEvent | str) –

    File event type

  • path (Path) –

    File path

  • source (None | FileEventIn, default: None ) –

    The FileEventIn instance that generated the message

ctime

ctime: float

Message creation time in "Unix time" format

type

type: FileEvent = type

File event type

path

path: Path = path

File path of event

source

source: None | FileEventIn

Input port instance that generated the message

matches

matches(
    type: None | Container[FileEvent] | FileEvent | str = None,
    path: None | Container[pathlib.Path] | pathlib.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 and contains the attribute, it matches the attribute.

Use Not(condition) to invert condition matching.

Returns:

  • bool

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