MCPcopy Create free account
hub / github.com/CommonstackAI/UncommonRoute / confirm

Method confirm

uncommon_route/onboarding.py:53–68  ·  view source on GitHub ↗
(self, prompt: str, *, default: bool = True)

Source from the content-addressed store, hash-verified

51 return self._choose_numbered(prompt, options, default=default)
52
53 def confirm(self, prompt: str, *, default: bool = True) -> bool:
54 suffix = "[Y/n]" if default else "[y/N]"
55 while True:
56 self.stdout.write(f"{prompt} {suffix} ")
57 self.stdout.flush()
58 answer = self.stdin.readline()
59 if answer == "":
60 return default
61 clean = answer.strip().lower()
62 if not clean:
63 return default
64 if clean in {"y", "yes"}:
65 return True
66 if clean in {"n", "no"}:
67 return False
68 self.stdout.write("Please answer y or n.\n")
69
70 def ask(
71 self,

Callers 1

_cmd_initFunction · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected