Skip to content

Commit

Permalink
[blackboard_watcher] updated pretty printing for nested attributes (n…
Browse files Browse the repository at this point in the history
…o more '/' conveniences) (#123)
  • Loading branch information
stonier committed Nov 12, 2019
1 parent 00166d6 commit 5dca7c5
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 11 deletions.
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

0 comments on commit 5dca7c5

Please sign in to comment.