Skip to content

Commit b13a6eb

Browse files
committed
temp
1 parent e568419 commit b13a6eb

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,9 @@ target_link_libraries(${BTCPP_LIBRARY}
191191
)
192192

193193
if(BTCPP_PYTHON)
194-
find_package(Python COMPONENTS Interpreter Development)
194+
set(PYBIND11_FINDPYTHON ON)
195195
find_package(pybind11 CONFIG)
196+
196197
message("PYTHON_EXECUTABLE: ${Python_EXECUTABLE}")
197198

198199
pybind11_add_module(btpy_cpp src/python/bindings.cpp)

btpy/__init__.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,18 +43,28 @@ class AsyncActionNode(StatefulActionNode):
4343
"""
4444

4545
def __init__(self, name, config):
46+
"""
47+
Initialize the AsyncActionNode with the given name and configuration.
48+
"""
4649
super().__init__(name, config)
4750

4851
def on_start(self) -> NodeStatus:
52+
"""
53+
Initialize the coroutine and return RUNNING status.
54+
"""
4955
self.coroutine = self.run()
5056
return NodeStatus.RUNNING
5157

5258
def on_running(self) -> NodeStatus:
59+
"""
60+
Resume the coroutine (generator). As long as the generator is not
61+
exhausted, keep this action in the RUNNING state.
62+
"""
5363
# The library logic should never allow this to happen, but users can
5464
# still manually call `on_running` without an associated `on_start`
5565
# call. Make sure to print a useful error when this happens.
5666
if self.coroutine is None:
57-
raise "AsyncActionNode run without starting"
67+
raise ValueError("AsyncActionNode run without starting")
5868

5969
# Resume the coroutine (generator). As long as the generator is not
6070
# exhausted, keep this action in the RUNNING state.
@@ -70,6 +80,9 @@ def on_running(self) -> NodeStatus:
7080
return NodeStatus.SUCCESS
7181

7282
def on_halted(self):
83+
"""
84+
What to do when the action is halted. Does nothing by default.
85+
"""
7386
# Default action: do nothing
7487
pass
7588

0 commit comments

Comments
 (0)