inotify

Platypush documentation

inotify#

class platypush.message.event.inotify.InotifyAccessEvent(path: str, resource: str | None = None, resource_type: str | None = None, *args, **kwargs)[source]#

Bases: InotifyEvent

Event triggered when a monitored resource is accessed.

__init__(path: str, resource: str | None = None, resource_type: str | None = None, *args, **kwargs)#
Parameters:
  • path – Monitored path.

  • resource – File/resource name.

  • resource_type – INotify type of the resource, if available.

as_dict()#

Converts the event into a dictionary

classmethod build(msg)#

Builds an event message from a JSON UTF-8 string/bytearray, a dictionary, or another Event

matches_condition(condition)#

If the event matches an event condition, it will return an EventMatchResult :param condition: The platypush.event.hook.EventCondition object

classmethod parse(msg)#

Parse a generic message into a key-value dictionary

Parameters:

msg – Original message. It can be a dictionary, a Message, or a string/bytearray, as long as it’s valid UTF-8 JSON

classmethod to_dict(msg)#

Converts a Message object into a dictionary

Parameters:

msg – Message object

class platypush.message.event.inotify.InotifyCloseEvent(path: str, resource: str | None = None, resource_type: str | None = None, *args, **kwargs)[source]#

Bases: InotifyEvent

Event triggered when a monitored resource is closed.

__init__(path: str, resource: str | None = None, resource_type: str | None = None, *args, **kwargs)#
Parameters:
  • path – Monitored path.

  • resource – File/resource name.

  • resource_type – INotify type of the resource, if available.

as_dict()#

Converts the event into a dictionary

classmethod build(msg)#

Builds an event message from a JSON UTF-8 string/bytearray, a dictionary, or another Event

matches_condition(condition)#

If the event matches an event condition, it will return an EventMatchResult :param condition: The platypush.event.hook.EventCondition object

classmethod parse(msg)#

Parse a generic message into a key-value dictionary

Parameters:

msg – Original message. It can be a dictionary, a Message, or a string/bytearray, as long as it’s valid UTF-8 JSON

classmethod to_dict(msg)#

Converts a Message object into a dictionary

Parameters:

msg – Message object

class platypush.message.event.inotify.InotifyCreateEvent(path: str, resource: str | None = None, resource_type: str | None = None, *args, **kwargs)[source]#

Bases: InotifyEvent

Event triggered when a monitored resource is created.

__init__(path: str, resource: str | None = None, resource_type: str | None = None, *args, **kwargs)#
Parameters:
  • path – Monitored path.

  • resource – File/resource name.

  • resource_type – INotify type of the resource, if available.

as_dict()#

Converts the event into a dictionary

classmethod build(msg)#

Builds an event message from a JSON UTF-8 string/bytearray, a dictionary, or another Event

matches_condition(condition)#

If the event matches an event condition, it will return an EventMatchResult :param condition: The platypush.event.hook.EventCondition object

classmethod parse(msg)#

Parse a generic message into a key-value dictionary

Parameters:

msg – Original message. It can be a dictionary, a Message, or a string/bytearray, as long as it’s valid UTF-8 JSON

classmethod to_dict(msg)#

Converts a Message object into a dictionary

Parameters:

msg – Message object

class platypush.message.event.inotify.InotifyDeleteEvent(path: str, resource: str | None = None, resource_type: str | None = None, *args, **kwargs)[source]#

Bases: InotifyEvent

Event triggered when a monitored resource is deleted.

__init__(path: str, resource: str | None = None, resource_type: str | None = None, *args, **kwargs)#
Parameters:
  • path – Monitored path.

  • resource – File/resource name.

  • resource_type – INotify type of the resource, if available.

as_dict()#

Converts the event into a dictionary

classmethod build(msg)#

Builds an event message from a JSON UTF-8 string/bytearray, a dictionary, or another Event

matches_condition(condition)#

If the event matches an event condition, it will return an EventMatchResult :param condition: The platypush.event.hook.EventCondition object

classmethod parse(msg)#

Parse a generic message into a key-value dictionary

Parameters:

msg – Original message. It can be a dictionary, a Message, or a string/bytearray, as long as it’s valid UTF-8 JSON

classmethod to_dict(msg)#

Converts a Message object into a dictionary

Parameters:

msg – Message object

class platypush.message.event.inotify.InotifyEvent(path: str, resource: str | None = None, resource_type: str | None = None, *args, **kwargs)[source]#

Bases: Event

Generic super-class for inotify events.

__init__(path: str, resource: str | None = None, resource_type: str | None = None, *args, **kwargs)[source]#
Parameters:
  • path – Monitored path.

  • resource – File/resource name.

  • resource_type – INotify type of the resource, if available.

as_dict()#

Converts the event into a dictionary

classmethod build(msg)#

Builds an event message from a JSON UTF-8 string/bytearray, a dictionary, or another Event

matches_condition(condition)#

If the event matches an event condition, it will return an EventMatchResult :param condition: The platypush.event.hook.EventCondition object

classmethod parse(msg)#

Parse a generic message into a key-value dictionary

Parameters:

msg – Original message. It can be a dictionary, a Message, or a string/bytearray, as long as it’s valid UTF-8 JSON

classmethod to_dict(msg)#

Converts a Message object into a dictionary

Parameters:

msg – Message object

class platypush.message.event.inotify.InotifyModifyEvent(path: str, resource: str | None = None, resource_type: str | None = None, *args, **kwargs)[source]#

Bases: InotifyEvent

Event triggered when a monitored resource is modified.

__init__(path: str, resource: str | None = None, resource_type: str | None = None, *args, **kwargs)#
Parameters:
  • path – Monitored path.

  • resource – File/resource name.

  • resource_type – INotify type of the resource, if available.

as_dict()#

Converts the event into a dictionary

classmethod build(msg)#

Builds an event message from a JSON UTF-8 string/bytearray, a dictionary, or another Event

matches_condition(condition)#

If the event matches an event condition, it will return an EventMatchResult :param condition: The platypush.event.hook.EventCondition object

classmethod parse(msg)#

Parse a generic message into a key-value dictionary

Parameters:

msg – Original message. It can be a dictionary, a Message, or a string/bytearray, as long as it’s valid UTF-8 JSON

classmethod to_dict(msg)#

Converts a Message object into a dictionary

Parameters:

msg – Message object

class platypush.message.event.inotify.InotifyMovedEvent(path: str, old: str | None = None, new: str | None = None, *args, **kwargs)[source]#

Bases: InotifyEvent

Event triggered when a resource in a monitored path is moved.

__init__(path: str, old: str | None = None, new: str | None = None, *args, **kwargs)[source]#
Parameters:
  • path – Monitored path.

  • old – Old name.

  • new – New name.

as_dict()#

Converts the event into a dictionary

classmethod build(msg)#

Builds an event message from a JSON UTF-8 string/bytearray, a dictionary, or another Event

matches_condition(condition)#

If the event matches an event condition, it will return an EventMatchResult :param condition: The platypush.event.hook.EventCondition object

classmethod parse(msg)#

Parse a generic message into a key-value dictionary

Parameters:

msg – Original message. It can be a dictionary, a Message, or a string/bytearray, as long as it’s valid UTF-8 JSON

classmethod to_dict(msg)#

Converts a Message object into a dictionary

Parameters:

msg – Message object

class platypush.message.event.inotify.InotifyOpenEvent(path: str, resource: str | None = None, resource_type: str | None = None, *args, **kwargs)[source]#

Bases: InotifyEvent

Event triggered when a monitored resource is opened.

__init__(path: str, resource: str | None = None, resource_type: str | None = None, *args, **kwargs)#
Parameters:
  • path – Monitored path.

  • resource – File/resource name.

  • resource_type – INotify type of the resource, if available.

as_dict()#

Converts the event into a dictionary

classmethod build(msg)#

Builds an event message from a JSON UTF-8 string/bytearray, a dictionary, or another Event

matches_condition(condition)#

If the event matches an event condition, it will return an EventMatchResult :param condition: The platypush.event.hook.EventCondition object

classmethod parse(msg)#

Parse a generic message into a key-value dictionary

Parameters:

msg – Original message. It can be a dictionary, a Message, or a string/bytearray, as long as it’s valid UTF-8 JSON

classmethod to_dict(msg)#

Converts a Message object into a dictionary

Parameters:

msg – Message object

class platypush.message.event.inotify.InotifyPermissionsChangeEvent(path: str, umask: int, resource: str | None = None, *args, **kwargs)[source]#

Bases: InotifyEvent

Event triggered when the permissions on a monitored resource are changed.

__init__(path: str, umask: int, resource: str | None = None, *args, **kwargs)[source]#
Parameters:
  • path – Monitored path.

  • umask – New umask.

  • resource – File/resource name.

as_dict()#

Converts the event into a dictionary

classmethod build(msg)#

Builds an event message from a JSON UTF-8 string/bytearray, a dictionary, or another Event

matches_condition(condition)#

If the event matches an event condition, it will return an EventMatchResult :param condition: The platypush.event.hook.EventCondition object

classmethod parse(msg)#

Parse a generic message into a key-value dictionary

Parameters:

msg – Original message. It can be a dictionary, a Message, or a string/bytearray, as long as it’s valid UTF-8 JSON

classmethod to_dict(msg)#

Converts a Message object into a dictionary

Parameters:

msg – Message object