dial_core.node_editor.node module¶
-
class
dial_core.node_editor.node.Node(title, inner_widget=None)[source]¶ Bases:
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- name (
-
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- name (
-
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]
-
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
-