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

Function _print_instances_plain

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

Source from the content-addressed store, hash-verified

339
340
341def _print_instances_plain(instances: list[dict[str, Any]], has_duplicates: bool) -> None:
342 cwd = os.getcwd()
343 headers = ["#", "Project"]
344 if has_duplicates:
345 headers.append("Path")
346 headers.extend(["Version", "Status", "Default"])
347
348 rows: list[list[str]] = []
349 for inst in instances:
350 row: list[str] = [
351 str(inst.get("ref_id", "")),
352 inst.get("project_name", inst.get("instance_id", "Unknown")),
353 ]
354 if has_duplicates:
355 row.append(os.path.relpath(inst.get("instance_id", ""), cwd))
356 row.extend(
357 [
358 inst.get("unity_version", "Unknown"),
359 _format_status(inst),
360 "*" if inst.get("is_default") else "",
361 ]
362 )
363 rows.append(row)
364 _print_plain_table(headers, rows, f"Connected Instances ({len(instances)})")
365
366
367_STATUS_STYLES: dict[str, str] = {

Callers 1

print_instances_tableFunction · 0.85

Calls 2

_format_statusFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected