Coverage for src / ezpl / handlers / wizard / core.py: 93.33%
15 statements
« prev ^ index » next coverage.py v7.13.4, created at 2026-03-13 19:35 +0000
« prev ^ index » next coverage.py v7.13.4, created at 2026-03-13 19:35 +0000
1# ///////////////////////////////////////////////////////////////
2# EZPL - Wizard Core
3# Project: ezpl
4# ///////////////////////////////////////////////////////////////
6"""
7Core RichWizard class for Ezpl logging framework.
9This module provides the main RichWizard class that combines all mixins
10for panels, tables, JSON, and progress functionality.
11"""
13from __future__ import annotations
15# ///////////////////////////////////////////////////////////////
16# IMPORTS
17# ///////////////////////////////////////////////////////////////
18# Third-party imports
19from rich.console import Console
21# Local imports
22from ...types import Pattern, get_pattern_color
23from .dynamic import DynamicProgressMixin
24from .json import JsonMixin
25from .panels import PanelMixin
26from .progress import ProgressMixin
27from .tables import TableMixin
29# ///////////////////////////////////////////////////////////////
30# CLASSES
31# ///////////////////////////////////////////////////////////////
34class RichWizard(
35 PanelMixin, TableMixin, JsonMixin, ProgressMixin, DynamicProgressMixin
36):
37 """
38 Rich Wizard for advanced console display capabilities.
40 This class provides specialized methods for creating and displaying
41 Rich-based panels, tables, JSON, and other formatted outputs,
42 including advanced progress bars.
44 The class combines multiple mixins to provide a unified API:
45 - PanelMixin: Panel display methods
46 - TableMixin: Table display methods
47 - JsonMixin: JSON display methods
48 - ProgressMixin: Progress bar methods
49 - DynamicProgressMixin: Dynamic layered progress bar methods
50 """
52 # ///////////////////////////////////////////////////////////////
53 # INIT
54 # ///////////////////////////////////////////////////////////////
56 def __init__(self, console: Console) -> None:
57 """
58 Initialize the Rich Wizard.
60 Args:
61 console: Rich Console instance to use for output
62 """
63 self._console = console
64 # Build prefix with Rich markup for progress bars (using SYSTEM pattern)
65 pattern_color = get_pattern_color(Pattern.SYSTEM)
66 self._progress_prefix = (
67 f"[{pattern_color}]• [bold {pattern_color}]{'SYSTEM'.ljust(8)}"
68 f"[/bold {pattern_color}][dim white]:: [/dim white]"
69 )
71 # ///////////////////////////////////////////////////////////////
72 # REPRESENTATION METHODS
73 # ///////////////////////////////////////////////////////////////
75 def __str__(self) -> str:
76 """String representation of the Rich Wizard."""
77 return "RichWizard()"
79 def __repr__(self) -> str:
80 """Detailed string representation of the Rich Wizard."""
81 return "RichWizard(console=Console())"