Skip to content

Commit

Permalink
Skip None Result (#646)
Browse files Browse the repository at this point in the history
Signed-off-by: jaywang <iwmq@qq.com>
(cherry picked from commit a9def45)

# Conflicts:
#	ros2param/ros2param/verb/list.py
  • Loading branch information
iwmq authored and mergify[bot] committed Jun 14, 2022
1 parent 3014cef commit 005d04d
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions ros2param/ros2param/verb/list.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,3 +104,29 @@ def main(self, *, args): # noqa: D102
print(
'Exception while calling service of node '
f"'{node_name.full_name}': {e}", file=sys.stderr)
<<<<<<< HEAD
=======
continue
response = future.result()
sorted_names = sorted(response.result.names)
if regex_filter is not None:
sorted_names = [name for name in sorted_names if regex_filter.match(name)]
if not args.node_name and sorted_names:
print(f'{node_name.full_name}:')
# get descriptors for the node if needs to print parameter type
name_to_type_map = {}
if args.param_type is True:
resp = call_describe_parameters(
node=node, node_name=node_name.full_name,
parameter_names=sorted_names)
for descriptor in resp.descriptors:
name_to_type_map[descriptor.name] = get_parameter_type_string(
descriptor.type)

for name in sorted_names:
if args.param_type is True:
param_type_str = name_to_type_map[name]
print(f' {name} (type: {param_type_str})')
else:
print(f' {name}')
>>>>>>> a9def45 (Skip None Result (#646))

0 comments on commit 005d04d

Please sign in to comment.