hte-cli 0.1.22__py3-none-any.whl → 0.1.24__py3-none-any.whl

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/cli.py CHANGED
@@ -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 "Starting..."
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
- # Sum up download progress
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
- if "complete" in status.lower():
462
- # Completed layers: use total as both downloaded and total
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 total > 0:
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"Done ({total_size_mb:.0f}MB)"
472
- return f"Done ({total_layers} layers)"
479
+ return f"done ({total_size_mb:.0f}MB)"
480
+ return f"done ({total_layers} layers)"
473
481
  elif total_size_mb > 0:
474
- return f"{total_downloaded_mb:.0f}MB / {total_size_mb:.0f}MB"
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"Pulling ({complete}/{total_layers} layers)"
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"Preparing ({total_layers} layers)"
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 - show live progress
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
- def show_progress(image: str, line: str):
510
- nonlocal last_summary
511
- on_image_progress(image, line)
512
- summary = get_progress_summary(image)
513
- if summary != last_summary:
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
- success = pull_image_with_progress(img, on_progress=show_progress)
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"\r [green]✓[/green] {short_name} [dim](downloaded)[/dim]" + " " * 30)
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"\r [red]✗[/red] {short_name} [dim](failed)[/dim]" + " " * 30)
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)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hte-cli
3
- Version: 0.1.22
3
+ Version: 0.1.24
4
4
  Summary: Human Time-to-Completion Evaluation CLI
5
5
  Project-URL: Homepage, https://github.com/sean-peters-au/lyptus-mono
6
6
  Author: Lyptus Research
@@ -1,13 +1,13 @@
1
1
  hte_cli/__init__.py,sha256=fDGXp-r8bIoLtlQnn5xJ_CpwMhonvk9bGjZQsjA2mDI,914
2
2
  hte_cli/__main__.py,sha256=63n0gNGfskidWDU0aAIF2N8lylVCLYKVIkrN9QiORoo,107
3
3
  hte_cli/api_client.py,sha256=mO4buDND5cIWESg4gSKb8WkdA1iPwkmTa0L3xL6lvNQ,8153
4
- hte_cli/cli.py,sha256=6Am35kEO-wHlhXYVgVWy2IodLqObPqOtFHnt0f8DQxo,27897
4
+ hte_cli/cli.py,sha256=S2FylZYU3dRctDKnEV-6BVLSINNISLXHdNh5jS4smiY,28229
5
5
  hte_cli/config.py,sha256=42Xv__YMSeRLs2zhGukJkIXFKtnBtYCHnONfViGyt2g,3387
6
6
  hte_cli/errors.py,sha256=1J5PpxcUKBu6XjigMMCPOq4Zc12tnv8LhAsiaVFWLQM,2762
7
7
  hte_cli/events.py,sha256=LCNLPJuk_Sz-rCl1Aa3k28y10_jwAx3urbnz3OXYPmE,3937
8
8
  hte_cli/runner.py,sha256=i0ubCA0N2scp-MoFbWGM9XP4w9UyhNN6g9PO4aJGl1o,23792
9
9
  hte_cli/version_check.py,sha256=WVZyGy2XfAghQYdd2N9-0Qfg-7pgp9gt4761-PnmacI,1708
10
- hte_cli-0.1.22.dist-info/METADATA,sha256=L9NqZbgRQQQge_9xBbIAopEH9eAGAFcNlmendwUra2o,3615
11
- hte_cli-0.1.22.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
12
- hte_cli-0.1.22.dist-info/entry_points.txt,sha256=XbyEEi1H14DFAt0Kdl22e_IRVEGzimSzYSh5HlhKlFA,41
13
- hte_cli-0.1.22.dist-info/RECORD,,
10
+ hte_cli-0.1.24.dist-info/METADATA,sha256=JLq5i3_jYvlA9YxSz1lMZIRXZta3UvKM5ESc-GHwx3o,3615
11
+ hte_cli-0.1.24.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
12
+ hte_cli-0.1.24.dist-info/entry_points.txt,sha256=XbyEEi1H14DFAt0Kdl22e_IRVEGzimSzYSh5HlhKlFA,41
13
+ hte_cli-0.1.24.dist-info/RECORD,,