Print a lightweight section separator. Args: title: The banner title text emoji: Optional emoji to prefix the title (e.g., "🔧", "📦") width: Total banner width (default 50) verbose: If False, suppress banner. If None, always print (backward compat)
(
title: str, emoji: str = "", width: int = 50, verbose: bool | None = None
)
| 25 | |
| 26 | |
| 27 | def print_banner( |
| 28 | title: str, emoji: str = "", width: int = 50, verbose: bool | None = None |
| 29 | ) -> None: |
| 30 | """Print a lightweight section separator. |
| 31 | |
| 32 | Args: |
| 33 | title: The banner title text |
| 34 | emoji: Optional emoji to prefix the title (e.g., "🔧", "📦") |
| 35 | width: Total banner width (default 50) |
| 36 | verbose: If False, suppress banner. If None, always print (backward compat) |
| 37 | """ |
| 38 | # Skip banner in non-verbose mode when verbose is explicitly False |
| 39 | if verbose is False: |
| 40 | return |
| 41 | |
| 42 | # Format title with emoji if provided |
| 43 | display_title = f"{emoji} {title}" if emoji else title |
| 44 | |
| 45 | # Simple single-line separator |
| 46 | padding = width - len(display_title) - 2 # -2 for leading "── " |
| 47 | if padding < 0: |
| 48 | padding = 0 |
| 49 | separator = f"── {display_title} " + "─" * padding |
| 50 | |
| 51 | # Print simple separator with timestamp (no blank line before for compactness) |
| 52 | print(f"{get_elapsed_str()} {separator}") |