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

Method prompt

bpython/urwid.py:211–227  ·  view source on GitHub ↗

Prompt the user for some input (with the optional prompt 's'). After the user hit enter the signal 'prompt_result' will be emitted and the status bar will be reset. If single is True, the first keypress will be returned.

(self, s=None, single=False)

Source from the content-addressed store, hash-verified

209 self.timer = None
210
211 def prompt(self, s=None, single=False):
212 """Prompt the user for some input (with the optional prompt 's'). After
213 the user hit enter the signal 'prompt_result' will be emitted and the
214 status bar will be reset. If single is True, the first keypress will be
215 returned."""
216
217 self._reset_timer()
218
219 self.edit.single = single
220 self.edit.set_caption(("main", s or "?"))
221 self.edit.set_edit_text("")
222 # hide the text and display the edit widget
223 if self.edit not in self.widget.widget_list:
224 self.widget.widget_list.append(self.edit)
225 if self.text in self.widget.widget_list:
226 self.widget.widget_list.remove(self.text)
227 self.widget.set_focus_column(0)
228
229 def settext(self, s, permanent=False):
230 """Set the text on the status bar to a new value. If permanent is True,

Callers 2

promptMethod · 0.45
ask_confirmationMethod · 0.45

Calls 2

_reset_timerMethod · 0.95
appendMethod · 0.80

Tested by

no test coverage detected