Пример #1
0
 def _set_text(self, text):
     """Replace runs with single run containing *text*"""
     self.clear()
     r = self.add_run()
     r.text = to_unicode(text)
Пример #2
0
 def text(self, str):
     """Set the text of this run to *str*."""
     self._r.t._setText(to_unicode(str))
Пример #3
0
 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)
Пример #4
0
def test_to_unicode_raises_on_non_string():
    """to_unicode(text) raises on *text* not a string"""
    with pytest.raises(TypeError):
        to_unicode(999)
Пример #5
0
def test_to_unicode_raises_on_non_string():
    """to_unicode(text) raises on *text* not a string"""
    with pytest.raises(TypeError):
        to_unicode(999)
Пример #6
0
 def text(self, text):
     """
     Replace all text in cell with single run containing *text*
     """
     self.textframe.text = to_unicode(text)
Пример #7
0
 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)