Skip to content

Commit 0c5da57

Browse files
author
Bret Wortman
committed
Update legend
Show counts in thaw list output
1 parent 338539b commit 0c5da57

File tree

1 file changed

+25
-2
lines changed

1 file changed

+25
-2
lines changed

curator/actions/deepfreeze/thaw.py

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -927,9 +927,32 @@ def do_list_requests(self) -> None:
927927
)
928928

929929
self.console.print(table)
930-
rprint(
931-
"[dim]Status: IP=In Progress, C=Completed, R=Refrozen, F=Failed, U=Unknown[/dim]"
930+
931+
# Count repos in each state
932+
status_counts = {
933+
"in_progress": 0,
934+
"completed": 0,
935+
"refrozen": 0,
936+
"failed": 0,
937+
"unknown": 0,
938+
}
939+
for req in requests:
940+
status = req.get("status", "unknown")
941+
if status in status_counts:
942+
status_counts[status] += 1
943+
else:
944+
status_counts["unknown"] += 1
945+
946+
# Build legend with counts
947+
legend = (
948+
f"[dim]Status: "
949+
f"IP=In Progress ({status_counts['in_progress']}), "
950+
f"C=Completed ({status_counts['completed']}), "
951+
f"R=Refrozen ({status_counts['refrozen']}), "
952+
f"F=Failed ({status_counts['failed']}), "
953+
f"U=Unknown ({status_counts['unknown']})[/dim]"
932954
)
955+
rprint(legend)
933956

934957
def _display_thaw_status(
935958
self, request: dict, repos: list, status_cache: dict = None

0 commit comments

Comments
 (0)