hornet.event – Events

HORNET uses a event-driven plugin framework. This module provides various types of events and methods for validating those events.

Module author: John Paulett <john.paulett -at- vanderbilt.edu>

exception hornet.event.EventNotAccepted
Exception that is thrown when a plugin can not handle the type of a given event.
class hornet.event.Event(data=None, caller=None)

Base class for events.

caller
class hornet.event.GraphsReady(data=None, caller=None)
Event that indicates that a list of graphs is ready for sharing with other plugins. the data must be a list or iterator of hornet.network.Graph objects.
class hornet.event.ProcessingStart(data=None, caller=None)
hornet.event.graphs_ready(event)

Utility method for determining if event is a hornet.event.GraphsReady event.

>>> e = GraphsReady(None)
>>> graphs_ready(e)
True
hornet.event.is_accepted_event(event, accepted_types)

Determines if the event is one of the accepted_types. event should be an instance of hornet.event.Event or instance of a subclass of hornet.event.Event. accepted_types can be a single class or a tuple of classes.

>>> e = GraphsReady(None)
>>> is_accepted_event(e, (GraphsReady,))
True

Previous topic

hornet.db – Database Connectivity

Next topic

hornet.file – File Interactions

This Page