INNER CODE UNIT · Python
filled
i3T4AN/KADATH · kadath/cli.py:139
filled = width if total <= 0 else max(0, min(width, round(width * completed / total)))
return _ansi("█" * filled, "38;5;84") + _ansi("░" * (width - filled), "38;5;245")
def _activity_summary(row: dict) -> str:
try:
payload = json.loads(row.get("payload_json") or "{}")
except (TypeError, json.JSONDecodeError):
payload = {}
summary = payload.get("summary") or payload.get("outcome") or row.get("kind", "activity")
return " ".join(str(summary).split())[:140]
def _render_dashboard(status: dict, styled: bool = False) -> str:
run = status["run"]
population = ", ".join(f"{row['status']}: {row['count']}" for row in status["population"])
if styled:
attempts = {row["status"]: int(row["count"]) for row in status.get("attempts", [])}