INNER CODE UNIT · Python
ColoredAsciiArtGroup
SearchSavior/OpenArc · src/cli/main.py:60
class ColoredAsciiArtGroup(click.RichGroup):
"""Custom Click group with cached ASCII art banner for performance."""
# Cache ASCII art as class attribute (built once, reused forever)
_ascii_art_cache = None
@classmethod
def _build_ascii_art(cls) -> Text:
"""Build and cache the ASCII art banner."""
if cls._ascii_art_cache is None:
# Build entire ASCII art in one go for better performance
ascii_lines = [
(" _____ ___ \n", "blue"),
("| _ | / _ \\ \n", "blue"),
("| | | |_ __ ___ _ __ / /_\\ \\_ __ ___ \n", "blue"),
("| | | | '_ \\ / _ \\ '_ \\| _ | '__/ __|\n", "blue"),
("\\ \\_/ / |_) | __/ | | | | | | | | (__ \n", "blue"),
(" \\___/| .__/ \\___|_| |_\\_| |_/_| \\___|\n", "blue"),