Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[blackboard_watcher] updated pretty printing for nested attributes #123

Merged
merged 1 commit into from
Nov 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 13 additions & 7 deletions .pydevproject
Original file line number Diff line number Diff line change
@@ -1,41 +1,46 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?eclipse-pydev version="1.0"?><pydev_project>








<pydev_pathproperty name="org.python.pydev.PROJECT_SOURCE_PATH">








<path>/${PROJECT_DIR_NAME}</path>








</pydev_pathproperty>








<pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python 3.6</pydev_property>








<pydev_property name="org.python.pydev.PYTHON_PROJECT_INTERPRETER">python</pydev_property>

<pydev_property name="org.python.pydev.PYTHON_PROJECT_INTERPRETER">python3</pydev_property>



Expand All @@ -44,4 +49,5 @@




</pydev_project>
4 changes: 2 additions & 2 deletions py_trees_ros/blackboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,8 +299,8 @@ def inner(v, k):
value = getattr(v, attr)
if not callable(value):
if not attr.isupper():
variables.append(k + "/" + attr)
inner(value, k + "/" + attr)
variables.append(k + "." + attr)
inner(value, k + "." + attr)

for key in sorted(py_trees.blackboard.Blackboard.storage):
variables.append(key)
Expand Down
4 changes: 2 additions & 2 deletions py_trees_ros/programs/blackboard_watcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,9 @@ def pretty_print_variables(variables):
s = "\n"
s += console.bold + console.cyan + "Blackboard Variables:" + console.reset + console.yellow + "\n"
for variable in variables:
variable = variable.split('/')
variable = variable.split('.')
if len(variable) > 1:
sep = "/"
sep = "."
else:
sep = ""
s += " " * len(variable) + sep + variable[-1] + "\n"
Expand Down