(instances: list[dict[str, Any]], has_duplicates: bool)
| 339 | |
| 340 | |
| 341 | def _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] = { |
no test coverage detected