-
Notifications
You must be signed in to change notification settings - Fork 91
Open
Labels
enhancementNew feature or requestNew feature or request
Description
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_nameif 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_Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request