hte-cli 0.1.22__tar.gz → 0.1.24__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {hte_cli-0.1.22 → hte_cli-0.1.24}/PKG-INFO +1 -1
- {hte_cli-0.1.22 → hte_cli-0.1.24}/pyproject.toml +1 -1
- {hte_cli-0.1.22 → hte_cli-0.1.24}/src/hte_cli/cli.py +35 -28
- {hte_cli-0.1.22 → hte_cli-0.1.24}/.gitignore +0 -0
- {hte_cli-0.1.22 → hte_cli-0.1.24}/README.md +0 -0
- {hte_cli-0.1.22 → hte_cli-0.1.24}/src/hte_cli/__init__.py +0 -0
- {hte_cli-0.1.22 → hte_cli-0.1.24}/src/hte_cli/__main__.py +0 -0
- {hte_cli-0.1.22 → hte_cli-0.1.24}/src/hte_cli/api_client.py +0 -0
- {hte_cli-0.1.22 → hte_cli-0.1.24}/src/hte_cli/config.py +0 -0
- {hte_cli-0.1.22 → hte_cli-0.1.24}/src/hte_cli/errors.py +0 -0
- {hte_cli-0.1.22 → hte_cli-0.1.24}/src/hte_cli/events.py +0 -0
- {hte_cli-0.1.22 → hte_cli-0.1.24}/src/hte_cli/runner.py +0 -0
- {hte_cli-0.1.22 → hte_cli-0.1.24}/src/hte_cli/version_check.py +0 -0
- {hte_cli-0.1.22 → hte_cli-0.1.24}/uv.lock +0 -0
|
@@ -448,34 +448,48 @@ def tasks_run(ctx, task_id: str | None):
|
|
|
448
448
|
def get_progress_summary(image: str) -> str:
|
|
449
449
|
"""Get a human-readable progress summary for an image with MB counts."""
|
|
450
450
|
if image not in image_layers or not image_layers[image]:
|
|
451
|
-
return "
|
|
451
|
+
return "connecting..."
|
|
452
452
|
|
|
453
453
|
layers = image_layers[image]
|
|
454
454
|
total_layers = len(layers)
|
|
455
|
-
complete = sum(1 for s, _, _ in layers.values() if "complete" in s.lower())
|
|
456
455
|
|
|
457
|
-
#
|
|
456
|
+
# Count layers in different states
|
|
457
|
+
complete = 0
|
|
458
|
+
downloading = 0
|
|
459
|
+
waiting = 0
|
|
458
460
|
total_downloaded_mb = 0
|
|
459
461
|
total_size_mb = 0
|
|
462
|
+
|
|
460
463
|
for status, downloaded, total in layers.values():
|
|
461
|
-
|
|
462
|
-
|
|
464
|
+
status_lower = status.lower()
|
|
465
|
+
if "complete" in status_lower:
|
|
466
|
+
complete += 1
|
|
463
467
|
total_downloaded_mb += total
|
|
464
468
|
total_size_mb += total
|
|
465
|
-
elif
|
|
469
|
+
elif "downloading" in status_lower:
|
|
470
|
+
downloading += 1
|
|
466
471
|
total_downloaded_mb += downloaded
|
|
467
472
|
total_size_mb += total
|
|
473
|
+
elif "waiting" in status_lower:
|
|
474
|
+
waiting += 1
|
|
468
475
|
|
|
476
|
+
# Choose the most informative display
|
|
469
477
|
if complete == total_layers and total_layers > 0:
|
|
470
478
|
if total_size_mb > 0:
|
|
471
|
-
return f"
|
|
472
|
-
return f"
|
|
479
|
+
return f"done ({total_size_mb:.0f}MB)"
|
|
480
|
+
return f"done ({total_layers} layers)"
|
|
473
481
|
elif total_size_mb > 0:
|
|
474
|
-
|
|
482
|
+
# Show MB progress when available
|
|
483
|
+
pct = int(100 * total_downloaded_mb / total_size_mb) if total_size_mb > 0 else 0
|
|
484
|
+
return f"{total_downloaded_mb:.0f}/{total_size_mb:.0f}MB ({pct}%)"
|
|
485
|
+
elif downloading > 0:
|
|
486
|
+
return f"downloading ({complete}/{total_layers} done)"
|
|
475
487
|
elif complete > 0:
|
|
476
|
-
return f"
|
|
488
|
+
return f"extracting ({complete}/{total_layers} done)"
|
|
489
|
+
elif waiting > 0:
|
|
490
|
+
return f"queued ({total_layers} layers)"
|
|
477
491
|
else:
|
|
478
|
-
return f"
|
|
492
|
+
return f"preparing ({total_layers} layers)"
|
|
479
493
|
|
|
480
494
|
def on_image_progress(image: str, line: str):
|
|
481
495
|
"""Track layer-level progress with size info."""
|
|
@@ -499,30 +513,23 @@ def tasks_run(ctx, task_id: str | None):
|
|
|
499
513
|
results.append((img, True, "cached"))
|
|
500
514
|
continue
|
|
501
515
|
|
|
502
|
-
# Need to pull -
|
|
503
|
-
console.print(f" [yellow]↓[/yellow] {short_name} [dim]pulling...[/dim]", end="")
|
|
504
|
-
|
|
505
|
-
# Clear the line and show progress updates
|
|
516
|
+
# Need to pull - use Rich Status for live updates
|
|
506
517
|
image_layers[img] = {}
|
|
507
|
-
last_summary = ""
|
|
508
518
|
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
# Clear line and rewrite
|
|
515
|
-
console.print(f"\r [yellow]↓[/yellow] {short_name} [dim]{summary}[/dim]" + " " * 20, end="")
|
|
516
|
-
last_summary = summary
|
|
519
|
+
with console.status(f"[yellow]↓[/yellow] {short_name} [dim]connecting...[/dim]") as status:
|
|
520
|
+
def show_progress(image: str, line: str):
|
|
521
|
+
on_image_progress(image, line)
|
|
522
|
+
summary = get_progress_summary(image)
|
|
523
|
+
status.update(f"[yellow]↓[/yellow] {short_name} [dim]{summary}[/dim]")
|
|
517
524
|
|
|
518
|
-
|
|
525
|
+
success = pull_image_with_progress(img, on_progress=show_progress)
|
|
519
526
|
|
|
520
|
-
# Final status
|
|
527
|
+
# Final status (printed after status context exits)
|
|
521
528
|
if success:
|
|
522
|
-
console.print(f"
|
|
529
|
+
console.print(f" [green]✓[/green] {short_name} [dim](downloaded)[/dim]")
|
|
523
530
|
results.append((img, True, "pulled"))
|
|
524
531
|
else:
|
|
525
|
-
console.print(f"
|
|
532
|
+
console.print(f" [red]✗[/red] {short_name} [dim](failed)[/dim]")
|
|
526
533
|
results.append((img, False, "failed"))
|
|
527
534
|
|
|
528
535
|
failed = sum(1 for _, ok, _ in results if not ok)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|