MCPcopy Create free account
hub / github.com/bigdra50/unity-cli / _print_instances_rich

Function _print_instances_rich

unity_cli/cli/output.py:375–404  ·  view source on GitHub ↗
(instances: list[dict[str, Any]], has_duplicates: bool)

Source from the content-addressed store, hash-verified

373
374
375def _print_instances_rich(instances: list[dict[str, Any]], has_duplicates: bool) -> None:
376 cwd = os.getcwd()
377 table = Table(title=f"Connected Instances ({len(instances)})")
378 table.add_column("#", style="dim", justify="right", no_wrap=True)
379 table.add_column("Project", style="cyan", no_wrap=True)
380 if has_duplicates:
381 table.add_column("Path (-i)", style="dim")
382 table.add_column("Unity Version", style="green")
383 table.add_column("Status", style="yellow")
384 table.add_column("Default", justify="center")
385
386 for inst in instances:
387 status = inst.get("status", "unknown")
388 display_status = _format_status(inst)
389 row_items: list[str | Text] = [
390 str(inst.get("ref_id", "")),
391 escape(inst.get("project_name", inst.get("instance_id", "Unknown"))),
392 ]
393 if has_duplicates:
394 row_items.append(escape(os.path.relpath(inst.get("instance_id", ""), cwd)))
395 row_items.extend(
396 [
397 escape(inst.get("unity_version", "Unknown")),
398 Text(escape(display_status), style=_STATUS_STYLES.get(status.lower(), "dim")),
399 "[green]*[/green]" if inst.get("is_default") else "",
400 ]
401 )
402 table.add_row(*row_items)
403
404 console.print(table)
405
406
407def print_logs_table(logs: list[dict[str, Any]]) -> None:

Callers 1

print_instances_tableFunction · 0.85

Calls 2

_format_statusFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected