Skip to content

Commit e14497e

Browse files
authored
Improve list hardware components output and code for better readability. (#1060)
1 parent dc01ae3 commit e14497e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

ros2controlcli/ros2controlcli/verb/list_hardware_components.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,17 @@ def main(self, *, args):
4040

4141
for idx, component in enumerate(hardware_components.component):
4242
print(
43-
f"Hardware Component {idx}\n\tname: {component.name}\n\ttype: {component.type}"
43+
f"Hardware Component {idx+1}\n\tname: {component.name}\n\ttype: {component.type}"
4444
)
4545
if hasattr(component, "plugin_name"):
4646
plugin_name = component.plugin_name
4747
else:
4848
plugin_name = f"{bcolors.WARNING}plugin name missing!{bcolors.ENDC}"
4949

5050
print(
51-
f"\tplugin name: {plugin_name}\n\tstate: id={component.state.id} label={component.state.label}\n\tcommand interfaces"
51+
f"\tplugin name: {plugin_name}\n"
52+
f"\tstate: id={component.state.id} label={component.state.label}\n"
53+
f"\tcommand interfaces"
5254
)
5355
for cmd_interface in component.command_interfaces:
5456
if cmd_interface.is_available:

0 commit comments

Comments
 (0)