Skip to content

Commit

Permalink
Fix verbose output of list_hardware_components (#1006)
Browse files Browse the repository at this point in the history
  • Loading branch information
christophfroehlich authored Apr 29, 2023
1 parent 76af238 commit bbd0516
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions ros2controlcli/ros2controlcli/verb/list_hardware_components.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,19 +60,13 @@ def main(self, *, args):
print(f'\t\t{cmd_interface.name} {available_str} {claimed_str}')

if args.verbose:
print('\tstate interfaces')
for state_interface in component.command_interfaces:

print("\tstate interfaces")
for state_interface in component.state_interfaces:
if state_interface.is_available:
available_str = f'{bcolors.OKBLUE}[available]{bcolors.ENDC}'
else:
available_str = f'{bcolors.WARNING}[unavailable]{bcolors.ENDC}'

if state_interface.is_claimed:
claimed_str = f'{bcolors.OKBLUE}[claimed]{bcolors.ENDC}'
else:
claimed_str = '[unclaimed]'

print(f'\t\t{state_interface.name} {available_str} {claimed_str}')
print(f"\t\t{state_interface.name} {available_str}")

return 0

0 comments on commit bbd0516

Please sign in to comment.