MCPcopy Index your code
hub / github.com/bpython/bpython / confirm

Method confirm

bpython/urwid.py:533–539  ·  view source on GitHub ↗

Ask for yes or no and call callback to return the result

(self, q, callback)

Source from the content-addressed store, hash-verified

531 self.callback = None
532
533 def confirm(self, q, callback):
534 """Ask for yes or no and call callback to return the result"""
535
536 def callback_wrapper(result):
537 callback(result.lower() in (_("y"), _("yes")))
538
539 self.prompt(q, callback_wrapper, single=True)
540
541 def notify(self, s, n=10, wait_for_keypress=False):
542 return self.statusbar.message(s, n)

Callers

nothing calls this directly

Calls 1

promptMethod · 0.95

Tested by

no test coverage detected