MCPcopy Create free account
hub / github.com/bpython/bpython / set_edit_markup

Method set_edit_markup

bpython/urwid.py:336–348  ·  view source on GitHub ↗

Call this when markup changes but the underlying text does not. You should arrange for this to be called from the 'change' signal.

(self, markup)

Source from the content-addressed store, hash-verified

334 self._invalidate()
335
336 def set_edit_markup(self, markup):
337 """Call this when markup changes but the underlying text does not.
338
339 You should arrange for this to be called from the 'change' signal.
340 """
341 if markup:
342 self._bpy_text, self._bpy_attr = urwid.decompose_tagmarkup(markup)
343 else:
344 # decompose_tagmarkup in some urwids fails on the empty list
345 self._bpy_text, self._bpy_attr = "", []
346 # This is redundant when we're called off the 'change' signal.
347 # I'm assuming this is cheap, making that ok.
348 self._invalidate()
349
350 def get_text(self):
351 return self._caption + self._bpy_text, self._attrib + self._bpy_attr

Callers 3

reprint_lineMethod · 0.80
on_input_changeMethod · 0.80
on_edit_pos_changedMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected