df
Some checks failed
smoke-mm / Install & smoke test mm --help (push) Has been cancelled
Some checks failed
smoke-mm / Install & smoke test mm --help (push) Has been cancelled
This commit is contained in:
@@ -33,7 +33,9 @@ class PipelineProgress:
|
||||
|
||||
pipe_idx: int = 0
|
||||
try:
|
||||
stage_ctx = self._ctx.get_stage_context() if hasattr(self._ctx, "get_stage_context") else None
|
||||
stage_ctx = (
|
||||
self._ctx.get_stage_context() if hasattr(self._ctx, "get_stage_context") else None
|
||||
)
|
||||
maybe_idx = getattr(stage_ctx, "pipe_index", None) if stage_ctx is not None else None
|
||||
if isinstance(maybe_idx, int):
|
||||
pipe_idx = int(maybe_idx)
|
||||
@@ -108,7 +110,9 @@ class PipelineProgress:
|
||||
except Exception:
|
||||
return
|
||||
|
||||
def update_transfer(self, *, label: str, completed: Optional[int], total: Optional[int] = None) -> None:
|
||||
def update_transfer(
|
||||
self, *, label: str, completed: Optional[int], total: Optional[int] = None
|
||||
) -> None:
|
||||
ui, _ = self.ui_and_pipe_index()
|
||||
if ui is None:
|
||||
return
|
||||
@@ -144,11 +148,15 @@ class PipelineProgress:
|
||||
except Exception:
|
||||
return
|
||||
|
||||
def ensure_local_ui(self, *, label: str, total_items: int, items_preview: Optional[Sequence[Any]] = None) -> bool:
|
||||
def ensure_local_ui(
|
||||
self, *, label: str, total_items: int, items_preview: Optional[Sequence[Any]] = None
|
||||
) -> bool:
|
||||
"""Start a local PipelineLiveProgress panel if no shared UI exists."""
|
||||
|
||||
try:
|
||||
existing = self._ctx.get_live_progress() if hasattr(self._ctx, "get_live_progress") else None
|
||||
existing = (
|
||||
self._ctx.get_live_progress() if hasattr(self._ctx, "get_live_progress") else None
|
||||
)
|
||||
except Exception:
|
||||
existing = None
|
||||
|
||||
@@ -170,7 +178,9 @@ class PipelineProgress:
|
||||
self._local_attached = False
|
||||
|
||||
try:
|
||||
ui.begin_pipe(0, total_items=max(1, int(total_items)), items_preview=list(items_preview or []))
|
||||
ui.begin_pipe(
|
||||
0, total_items=max(1, int(total_items)), items_preview=list(items_preview or [])
|
||||
)
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
@@ -210,7 +220,9 @@ class PipelineProgress:
|
||||
total_items: int,
|
||||
items_preview: Optional[Sequence[Any]] = None,
|
||||
) -> Iterator["PipelineProgress"]:
|
||||
created = self.ensure_local_ui(label=label, total_items=total_items, items_preview=items_preview)
|
||||
created = self.ensure_local_ui(
|
||||
label=label, total_items=total_items, items_preview=items_preview
|
||||
)
|
||||
try:
|
||||
yield self
|
||||
finally:
|
||||
|
||||
Reference in New Issue
Block a user