mdpo.event module

Custom events executed during the parsing process of an implementation.

mdpo.event._block_msg(block, details)
mdpo.event.add_debug_events(implementation_name, events)

Add debugging events to an events dict.

Parameters:
  • implementation_name (str) – Implementation name, shown when printing debugging events.

  • events (dict) – Events dictionary.

mdpo.event.debug_events(program)

Debugging events for interfaces. Displays in STDOUT all event targets.

Parameters:

program (str) – Command line interface name, to display it at the beginning of the output.

Returns:

Event target printing functions.

Return type:

dict

mdpo.event.parse_events_kwarg(events_kwarg)

Parse events kwarg passed to implementations.

Each event can be a function or a path to a function inside a file using the syntax path/to/file.py::function.

Parameters:

events_kwarg (dict) – Dictionary of event names and their location.

Returns:

Event names mapping to a list of functions to execute.

Return type:

dict

mdpo.event.raise_skip_event(events, event_name, *event_args)

Execute all functions defined for an event of a parser.

If a function returns False, this function will return True meaning that an event is trying to skip the associated function.

Parameters:
  • events (dict) – Dictionary with all events defined.

  • event_name (str) – Name of the event whose functions will be executed.

  • *event_args – Arguments propagated to the events functions.

Returns:

True if an event function returns False, False otherwise.

Return type:

bool