Skip to content

Commit

Permalink
Address minor issues
Browse files Browse the repository at this point in the history
Signed-off-by: Emerson Knapp <emerson.b.knapp@gmail.com>
  • Loading branch information
emersonknapp committed Mar 13, 2020
1 parent 13158bc commit 418ea4c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
10 changes: 5 additions & 5 deletions ros2node/ros2node/api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def parse_node_name(node_name):

def annotate_duplicate_nodes(node_names: List[NodeName]) -> Tuple[bool, List[str]]:
"""
Annotate a list of node names with a warnings if names are not unique.
Annotate a list of node names with a warning if names are not unique.
:param node_names: list of all NodeNames observed in the graph
:return Tuple containing:
Expand All @@ -66,13 +66,13 @@ def annotate_duplicate_nodes(node_names: List[NodeName]) -> Tuple[bool, List[str
count = name_count.get(n.full_name, 0) + 1
if count > 1:
any_duplicates = True
name_count[n.full_name] = name_count.get(n.full_name, 0) + 1
name_count[n.full_name] = count

sorted_names = sorted(
annotated_names = [
n.full_name + (annotation_string if name_count[n.full_name] > 1 else '')
for n in node_names
)
return any_duplicates, sorted_names
]
return any_duplicates, annotated_names


def get_node_names(*, node, include_hidden_nodes=False):
Expand Down
1 change: 1 addition & 0 deletions ros2node/ros2node/verb/list.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import sys

from ros2cli.node.strategy import add_arguments
Expand Down

0 comments on commit 418ea4c

Please sign in to comment.