From 2b1542271f6e0898a31336e69f6339c13e4efa00 Mon Sep 17 00:00:00 2001 From: Daniel Stonier Date: Mon, 11 Nov 2019 23:53:00 -0500 Subject: [PATCH] [blackboard_watcher] updated pretty printing for nested attributes (no more '/' conveniences) --- .pydevproject | 20 +++++++++++++------- py_trees_ros/blackboard.py | 4 ++-- py_trees_ros/programs/blackboard_watcher.py | 4 ++-- 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/.pydevproject b/.pydevproject index 47062f9e..cb56d9ac 100644 --- a/.pydevproject +++ b/.pydevproject @@ -1,41 +1,46 @@ - + + - + + /${PROJECT_DIR_NAME} - + + - + + python 3.6 - + + - python - + python3 + @@ -44,4 +49,5 @@ + diff --git a/py_trees_ros/blackboard.py b/py_trees_ros/blackboard.py index 72cb9dd6..9426ad2f 100644 --- a/py_trees_ros/blackboard.py +++ b/py_trees_ros/blackboard.py @@ -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) diff --git a/py_trees_ros/programs/blackboard_watcher.py b/py_trees_ros/programs/blackboard_watcher.py index 89ef8944..9578df8a 100644 --- a/py_trees_ros/programs/blackboard_watcher.py +++ b/py_trees_ros/programs/blackboard_watcher.py @@ -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"