cars.core.progress.ui ===================== .. py:module:: cars.core.progress.ui .. autoapi-nested-parse:: Rich-based UI for hierarchical pipeline progress display. Displays a tree of pipelines with status icons, indentation, and progress bars. Uses Rich's Live display to update content in place. Classes ------- .. autoapisummary:: cars.core.progress.ui.UINode cars.core.progress.ui.PipelineTreeUI Module Contents --------------- .. py:class:: UINode Represents a displayable node in the pipeline tree. .. py:attribute:: name :type: str .. py:attribute:: indent :type: int :value: 0 .. py:attribute:: pipeline_id :type: int | None :value: None .. py:attribute:: progress :type: float :value: 0.0 .. py:attribute:: retries :type: int :value: 0 .. py:attribute:: failed :type: int :value: 0 .. py:attribute:: state :type: str :value: 'pending' .. py:attribute:: children :type: list[UINode] :value: [] .. py:method:: status_icon() -> str Return an icon for the current state. .. py:class:: PipelineTreeUI(console: rich.console.Console | None = None) Rich-based UI for displaying hierarchical pipeline progress. .. py:attribute:: console .. py:attribute:: tree :type: dict[int, UINode] .. py:attribute:: _order :type: list[int] :value: [] .. py:attribute:: live :type: rich.live.Live | None :value: None .. py:attribute:: empty_status_text :type: str :value: 'Loading configuration file' .. py:attribute:: warning_count :type: int :value: 0 .. py:attribute:: log_file_path :type: str | None :value: None .. py:attribute:: crash_exception :type: BaseException | None :value: None .. py:attribute:: success_output_dir :type: str | None :value: None .. py:method:: update_empty_status_text(status_text: str) -> None Update startup status, shown before any pipeline is registered. .. py:method:: update_warning_count(warning_count: int) -> None Update total warning counter displayed in the panel footer. .. py:method:: update_log_file_path(log_file_path: str | None) -> None Update log file path used by the footer log link button. .. py:method:: update_crash(exception: BaseException) -> None Store crash exception for rich crash rendering. .. py:method:: update_success(output_dir: str | None) -> None Store successful output directory for final success rendering. .. py:method:: _path_to_uri(path_str: str) -> str Convert path string to clickable file URI. .. py:method:: _render_log_button() -> rich.text.Text Render a clickable footer button linking to the current log file. .. py:method:: _render_success_panel() -> rich.panel.Panel | None Render final success panel with output links using Tree. .. py:method:: add_node(node_id: int, name: str, indent: int = 0, parent_id: int | None = None) -> None Add a node to the tree. .. py:method:: update_state(node_id: int, state: str) -> None Update node state: pending, running, completed. .. py:method:: update_progress(node_id: int, progress: float, retries: int = 0, failed: int = 0) -> None Update node progress (0.0 to 1.0) and retry count. .. py:method:: _node_label(node: UINode, depth: int) -> str Build a plain node label used for width calculation. .. py:method:: _label_renderable(node: UINode, depth: int) -> rich.console.RenderableType Render label with tabs first, then status icon/spinner and name. .. py:method:: _compute_label_width() -> int Compute a shared width so all bars start at the same column. .. py:method:: _render_node(node: UINode, depth: int = 0, label_width: int = 24) -> list[rich.console.RenderableType] Render a single node and its children as a list of Rich renderables. .. py:method:: _render_full_tree() -> rich.panel.Panel Render the full tree as a Rich Panel. .. py:method:: display() -> None Render the full tree to console using Live display. .. py:method:: display_final() -> None Stop Live display and display the final rendered view once.