MCPcopy
hub / github.com/MinishLab/semble / _checkbox

Function _checkbox

src/semble/installer/installer.py:136–149  ·  view source on GitHub ↗

Show an interactive multi-select checkbox; return selected values or None if cancelled.

(prompt: str, items: Sequence[tuple[str, _T, bool]])

Source from the content-addressed store, hash-verified

134
135
136def _checkbox(prompt: str, items: Sequence[tuple[str, _T, bool]]) -> list[_T] | None:
137 """Show an interactive multi-select checkbox; return selected values or None if cancelled."""
138 # prompt_toolkit defaults "selected" to reverse-video (a filled block); override it
139 # so checked rows show a clean green ● and the cursor row is just bold.
140 style = questionary.Style(
141 [
142 ("pointer", "bold"),
143 ("highlighted", "noreverse bold"),
144 ("selected", "noreverse fg:ansigreen"),
145 ]
146 )
147 choices = [questionary.Choice(title=label, value=value, checked=checked) for label, value, checked in items]
148 instruction = "(↑↓ move · space select · a all · enter confirm)"
149 return questionary.checkbox(prompt, choices=choices, style=style, instruction=instruction).ask()
150
151
152def _print_plan(agents: list[AgentTarget], integrations: list[_Integration]) -> None:

Callers 2

test_checkboxFunction · 0.90
runFunction · 0.85

Calls 1

askMethod · 0.45

Tested by 1

test_checkboxFunction · 0.72