def _set_text(self, text): """Replace runs with single run containing *text*""" self.clear() r = self.add_run() r.text = to_unicode(text)
def text(self, str): """Set the text of this run to *str*.""" self._r.t._setText(to_unicode(str))
def _set_text(self, text): """Replace all text in text frame with single run containing *text*""" self.clear() self.paragraphs[0].text = to_unicode(text)
def test_to_unicode_raises_on_non_string(): """to_unicode(text) raises on *text* not a string""" with pytest.raises(TypeError): to_unicode(999)
def text(self, text): """ Replace all text in cell with single run containing *text* """ self.textframe.text = to_unicode(text)
def _set_text(self, text): """Replace all text in shape with single run containing *text*""" if not self.has_textframe: raise TypeError("cannot set text of shape with no text frame") self.textframe.text = to_unicode(text)