(
line: dict[str, Any], layers_info: dict[str, str], status: Any, last_update: str
)
| 1376 | |
| 1377 | |
| 1378 | def process_pull_line( |
| 1379 | line: dict[str, Any], layers_info: dict[str, str], status: Any, last_update: str |
| 1380 | ) -> str: |
| 1381 | if "id" in line and "status" in line: |
| 1382 | layer_id = line["id"] |
| 1383 | update_layer_status(layers_info, layer_id, line["status"]) |
| 1384 | |
| 1385 | completed = sum(1 for v in layers_info.values() if v == "✓") |
| 1386 | total = len(layers_info) |
| 1387 | |
| 1388 | if total > 0: |
| 1389 | update_msg = f"[bold cyan]Progress: {completed}/{total} layers complete" |
| 1390 | if update_msg != last_update: |
| 1391 | status.update(update_msg) |
| 1392 | return update_msg |
| 1393 | |
| 1394 | elif "status" in line and "id" not in line: |
| 1395 | global_status = line["status"] |
| 1396 | if "Pulling from" in global_status: |
| 1397 | status.update("[bold cyan]Fetching image manifest...") |
| 1398 | elif "Digest:" in global_status: |
| 1399 | status.update("[bold cyan]Verifying image...") |
| 1400 | elif "Status:" in global_status: |
| 1401 | status.update("[bold cyan]Finalizing...") |
| 1402 | |
| 1403 | return last_update |
| 1404 | |
| 1405 | |
| 1406 | def validate_config_file(config_path: str) -> Path: |
no test coverage detected