Skip to content

Commit

Permalink
Optimize list hardware componets output and code for better readability.
Browse files Browse the repository at this point in the history
  • Loading branch information
destogl committed Jun 17, 2023
1 parent 99deef8 commit f66be7b
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,16 @@ def main(self, *, args):

for idx, component in enumerate(hardware_components.component):
print(
f"Hardware Component {idx}\n\tname: {component.name}\n\ttype: {component.type}"
f"Hardware Component {idx+1}\n\tname: {component.name}\n\ttype: {component.type}"
)
if hasattr(component, "plugin_name"):
plugin_name = component.plugin_name
else:
plugin_name = f"{bcolors.WARNING}plugin name missing!{bcolors.ENDC}"

print(
f"\tplugin name: {plugin_name}\n\tstate: id={component.state.id} label={component.state.label}\n\tcommand interfaces"
)
print(f"\tplugin name: {plugin_name}\n"
f"\tstate: id={component.state.id} label={component.state.label}\n"
f"\tcommand interfaces")
for cmd_interface in component.command_interfaces:
if cmd_interface.is_available:
available_str = f"{bcolors.OKBLUE}[available]{bcolors.ENDC}"
Expand Down

0 comments on commit f66be7b

Please sign in to comment.