Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize list hardware components output and code for better readability. #1060

Merged
merged 3 commits into from
Jun 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,17 @@ 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"
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:
Expand Down