Description
Have action.Node to expose the self.__node_name attribute as a property:
Motivation
I want to have access to the Node's name as a property to be able to filter a specific node from a container:
def find_node_by_name(name: str, nodes: list[Node]):
return next((node for node in nodes if node.name == name), None)
NODES = [
Node(name='foo'),
Node(name='bar'),
Node(name='zaz'),
]
def __name__ == '__main__':
foo_node = find_node_by_name('foo', NODES)
Design / Implementation Considerations
@expose_action('node')
class Node(ExecuteProcess):
...
@property
def name(self):
"""Getter for name."""
return self.__node_name
if it is an issue overriding ExecuteProcess.name property we can expose the property as node_name instead:
@property
def node_name(self):
"""Getter for name."""
return self.__node_name
### Additional Information
_No response_
Description
Have action.Node to expose the
self.__node_nameattribute as a property:Motivation
I want to have access to the Node's name as a property to be able to filter a specific node from a container:
Design / Implementation Considerations
if it is an issue overriding
ExecuteProcess.nameproperty we can expose the property asnode_nameinstead: