Skip to content

Commit

Permalink
client: names in compact output when listing resources
Browse files Browse the repository at this point in the history
Signed-off-by: Felix Zwettler <[email protected]>
  • Loading branch information
flxzt committed Jul 15, 2024
1 parent 2b5a67f commit d2a0acb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions labgrid/remote/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,19 +240,19 @@ async def print_resources(self):
else:
places = None

results.append((places, exporter, group_name, resource.cls))
results.append((places, exporter, group_name, resource.cls, resource_name))

results = sorted(results, key=lambda res: res[0][0].changed if res[0] else 0)

for places, exporter, group_name, resource_cls in results:
for places, exporter, group_name, resource_cls, resource_name in results:
if self.args.sort_by_matched_place_change:
places_strs = [f"{p.name}: {datetime.fromtimestamp(p.changed):%Y-%m-%d}" for p in places]
places_info = ", ".join(places_strs) if places_strs else "not used by any place"

else:
places_info = None

line = f"{exporter}/{group_name}/{resource_cls}"
line = f"{exporter}/{group_name}/{resource_cls}[/{resource_name}]"
if places_info is not None:
print(f"{line:<50s} {places_info}")
else:
Expand Down

0 comments on commit d2a0acb

Please sign in to comment.