dial_core.node_editor.node module

class dial_core.node_editor.node.Node(title, inner_widget=None)[source]

Bases: object

__repr__()[source]

Returns the object representation of the Port object (with mem address).

__str__()[source]

Retuns the string representation of the Port object.

add_input_port(name, port_type)[source]

Creates a new input port and adds it to the list of ports.

Parameters:
  • name (str) – Name of the port.
  • port_type (Any) – Type of the port.
Retuns:
The added InputPort instance.
Return type:InputPort
add_output_port(name, port_type)[source]

Creates a new output port and adds it to the list of ports.

Parameters:
  • name (str) – Name of the port.
  • port_type (Any) – Type of the port.
Retuns:
The added InputPort instance.
Return type:OutputPort
add_port(port)[source]

Adds a port instance to this node.

Important

The port to add must be a child of InputPort or OutputPort. Otherwise, it won’t be added and a TypeError exception will be raised.

Retuns:
The port instance added.
Raises:
  • TypeError – If the port argument passed is not a chid of InputPort or
  • OutputPort
Return type:

Union[InputPort, OutputPort]

property inner_widget

Returns the inner widget set on the node (Or None if not used).

Return type:Optional[Any]
property inputs

Returns a list of the input ports of the node.

Return type:Dict[str, InputPort]
property outputs

Returns a list of the output ports of the node.

Return type:Dict[str, OutputPort]
process()[source]

Sends the output of each port to the connected nodes.

remove_input_port(port_name)[source]

Removes an input port from the list of input ports.

Parameters:port_name (str) – Name of the port being removed.
Raises:ValueError – If can’t find a port to remove named port_name.
remove_output_port(port_name)[source]

Removes an output port from the list of output ports.

Parameters:port_name (str) – Name of the port being removed.
Raises:ValueError – If can’t find a port to remove named port_name.
property title

Returns the title of the node.

Return type:str