Browse Source

Add dataflow_id getter in python

tags/v0.3.4
haixuantao 1 year ago
parent
commit
0f530906aa
2 changed files with 10 additions and 0 deletions
  1. +3
    -0
      apis/python/node/dora/__init__.pyi
  2. +7
    -0
      apis/python/node/src/lib.rs

+ 3
- 0
apis/python/node/dora/__init__.pyi View File

@@ -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."""


+ 7
- 0
apis/python/node/src/lib.rs View File

@@ -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.
///


Loading…
Cancel
Save