(
self, group: "RunningProcessGroup", config: Optional[DisplayConfig] = None
)
| 198 | """Rich library-based status display with enhanced formatting.""" |
| 199 | |
| 200 | def __init__( |
| 201 | self, group: "RunningProcessGroup", config: Optional[DisplayConfig] = None |
| 202 | ): |
| 203 | if config is None: |
| 204 | config = DisplayConfig(format_type="rich") |
| 205 | super().__init__(group, config) |
| 206 | |
| 207 | try: |
| 208 | from rich.console import Console |
| 209 | from rich.live import Live |
| 210 | from rich.progress import Progress |
| 211 | from rich.table import Table |
| 212 | |
| 213 | self.Progress = Progress |
| 214 | self.Live = Live |
| 215 | self.Table = Table |
| 216 | self.Console = Console |
| 217 | self._rich_available = True |
| 218 | |
| 219 | self._spinner_chars = ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧"] |
| 220 | self._status_chars = { |
| 221 | "running": "⠋", |
| 222 | "done": "✓", |
| 223 | "failed": "✗", |
| 224 | "pending": " ", |
| 225 | } |
| 226 | except ImportError: |
| 227 | logger.warning("Rich not available, falling back to ASCII display") |
| 228 | self._rich_available = False |
| 229 | # Fallback to ASCII chars |
| 230 | self._spinner_chars = ["|", "/", "-", "\\\\"] |
| 231 | self._status_chars = { |
| 232 | "running": "|>", |
| 233 | "done": "OK", |
| 234 | "failed": "XX", |
| 235 | "pending": "--", |
| 236 | } |
| 237 | |
| 238 | def format_status_line( |
| 239 | self, group_status: "GroupStatus", spinner_index: int |
no test coverage detected