flowpipe.plug module¶
Plugs are ins and outs for Nodes through which they exchange data.
- class flowpipe.plug.IPlug(name, node)¶
Bases:
object
The interface for the plugs.
Plugs are associated with a Node and can be connected, disconnected and hold a value, that can be accesses by the associated Node.
- abstract connect(plug)¶
Has to be implemented in the subclass.
- disconnect(plug)¶
Break the connection to the given Plug.
- property is_dirty¶
Access to the dirty status on this Plug.
- promote_to_graph(name=None)¶
Add this plug to the graph of this plug’s node.
- Parameters:
name (str) – Optionally provide a different name for the Plug
- property value¶
Access to the value on this Plug.
- class flowpipe.plug.InputPlug(name, node, value=None)¶
Bases:
IPlug
Receives data from an OutputPlug.
- connect(plug)¶
Connect this Plug to the given OutputPlug.
Set both participating Plugs dirty.
- serialize()¶
Serialize the Plug containing all it’s connections.
- class flowpipe.plug.InputPlugGroup(name, graph, plugs=None)¶
Bases:
object
Group plugs inside a group into one entry point on the graph.
- connect(plug)¶
Connect all plugs in this group to the given plug.
- disconnect(plug)¶
Disconnect all plugs in this group from the given plug.
- property value¶
Getting the value of an InputPlugGroup is not supported.
The value property is implemented nonetheless, in order to allow for convenient setting of the value of all plugs in the InputPlugGroup.
- class flowpipe.plug.OutputPlug(name, node)¶
Bases:
IPlug
Provides data to an InputPlug.
- connect(plug)¶
Connect this Plug to the given InputPlug.
Set both participating Plugs dirty.
- serialize()¶
Serialize the Plug containing all it’s connections.
- class flowpipe.plug.SubInputPlug(key, node, parent_plug, value=None)¶
-
Held by a parent input plug to form a compound plug.
- serialize()¶
Serialize the Plug containing all it’s connections.
- class flowpipe.plug.SubOutputPlug(key, node, parent_plug, value=None)¶
Bases:
SubPlug
,OutputPlug
Held by a parent output plug to form a compound plug.
- serialize()¶
Serialize the Plug containing all it’s connections.
- class flowpipe.plug.SubPlug¶
Bases:
object
Mixin that unifies common properties of subplugs.
- property is_dirty¶
Access to the dirty status on this Plug.
- promote_to_graph(name=None)¶
Add this plug to the graph of this plug’s node.
NOTE: Subplugs can only be added to a graph via their parent plug.
- Parameters:
name (str) – Optionally provide a different name for the Plug