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

Method settext

bpython/urwid.py:229–244  ·  view source on GitHub ↗

Set the text on the status bar to a new value. If permanent is True, the new value will be permanent. If that status bar is in prompt mode, the prompt will be aborted.

(self, s, permanent=False)

Source from the content-addressed store, hash-verified

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,
231 the new value will be permanent. If that status bar is in prompt mode,
232 the prompt will be aborted."""
233
234 self._reset_timer()
235
236 # hide the edit and display the text widget
237 if self.edit in self.widget.widget_list:
238 self.widget.widget_list.remove(self.edit)
239 if self.text not in self.widget.widget_list:
240 self.widget.widget_list.append(self.text)
241
242 self.text.set_text(("main", s))
243 if permanent:
244 self.s = s
245
246 def clear(self):
247 """Clear the status bar."""

Callers 4

_checkMethod · 0.95
messageMethod · 0.95
clearMethod · 0.95
_on_prompt_enterMethod · 0.95

Calls 2

_reset_timerMethod · 0.95
appendMethod · 0.80

Tested by

no test coverage detected