MCPcopy Create free account
hub / github.com/FastLED/FastLED / print_tree_status

Method print_tree_status

ci/util/banner_print.py:81–113  ·  view source on GitHub ↗

Print tree-style status messages. Example output: 🔍 Checking packages... ├─ Validating integrity... ├─ ❌ Missing: toolchain-riscv32-esp └─ 📦 Installation required Args: root: Root message (first line)

(root: str, items: list[tuple[str, str, str | None]])

Source from the content-addressed store, hash-verified

79
80 @staticmethod
81 def print_tree_status(root: str, items: list[tuple[str, str, str | None]]) -> None:
82 """Print tree-style status messages.
83
84 Example output:
85 🔍 Checking packages...
86 ├─ Validating integrity...
87 ├─ ❌ Missing: toolchain-riscv32-esp
88 └─ 📦 Installation required
89
90 Args:
91 root: Root message (first line)
92 items: List of (icon, message, status_type) tuples
93 status_type can be: "success", "error", "warning", "info", or None
94 """
95 print(root)
96
97 for i, (icon, message, status_type) in enumerate(items):
98 is_last = i == len(items) - 1
99 branch = BannerPrinter.TREE_LAST if is_last else BannerPrinter.TREE_BRANCH
100
101 # Add color/emphasis based on status type if provided
102 if status_type == "success":
103 formatted_msg = f"{icon} {message}"
104 elif status_type == "error":
105 formatted_msg = f"{icon} {message}"
106 elif status_type == "warning":
107 formatted_msg = f"{icon} {message}"
108 elif status_type == "info":
109 formatted_msg = f"{icon} {message}"
110 else:
111 formatted_msg = f"{icon} {message}" if icon else message
112
113 print(f" {branch} {formatted_msg}")
114
115 @staticmethod
116 def print_success_banner(message: str, elapsed_time: str | None = None) -> None:

Callers 1

print_tree_statusFunction · 0.80

Calls 1

printFunction · 0.50

Tested by

no test coverage detected