From 0f530906aaa34da07bcc55d63a97a22e4f956584 Mon Sep 17 00:00:00 2001 From: haixuantao Date: Sat, 18 May 2024 10:27:11 +0200 Subject: [PATCH] Add dataflow_id getter in python --- apis/python/node/dora/__init__.pyi | 3 +++ apis/python/node/src/lib.rs | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/apis/python/node/dora/__init__.pyi b/apis/python/node/dora/__init__.pyi index e74b2a96..b083d4f9 100644 --- a/apis/python/node/dora/__init__.pyi +++ b/apis/python/node/dora/__init__.pyi @@ -39,6 +39,9 @@ node = Node() This method returns the parsed dataflow YAML file.""" + def dataflow_id(self) -> str: + """Returns the dataflow id.""" + def merge_external_events(self, subscription: dora.Ros2Subscription) -> None: """Merge an external event stream with dora main loop. This currently only work with ROS2.""" diff --git a/apis/python/node/src/lib.rs b/apis/python/node/src/lib.rs index f6f47ed9..95fd29c7 100644 --- a/apis/python/node/src/lib.rs +++ b/apis/python/node/src/lib.rs @@ -154,6 +154,13 @@ impl Node { pythonize::pythonize(py, self.node.dataflow_descriptor()) } + /// Returns the dataflow id. + /// + /// :rtype: str + pub fn dataflow_id(&self) -> String { + self.node.dataflow_id().to_string() + } + /// Merge an external event stream with dora main loop. /// This currently only work with ROS2. ///