Esempio n. 1
0
 def word_wrap(self, value):
     value_map = {True: 'square', False: 'none'}
     bodyPr = get_or_add(self._txBody, 'a:bodyPr')
     if value is None:
         if 'wrap' in bodyPr.attrib:
             del bodyPr.attrib['wrap']
         return
     bodyPr.set('wrap', value_map[value])
Esempio n. 2
0
 def _set_vertical_anchor(self, value):
     """
     Set ``anchor`` attribute of ``<a:bodyPr>`` element
     """
     value_map = {
         MSO.ANCHOR_TOP:    't',
         MSO.ANCHOR_MIDDLE: 'ctr',
         MSO.ANCHOR_BOTTOM: 'b'
     }
     bodyPr = get_or_add(self._txBody, 'a:bodyPr')
     bodyPr.set('anchor', value_map[value])
Esempio n. 3
0
 def word_wrap(self):
     """
     Read-write value of the word wrap setting for this text frame, either
     True, False, or None. Assignment to *word_wrap* sets the wrapping
     behavior. True and False turn word wrap on and off, respectively.
     Assigning None to word wrap causes its word wrap setting to be
     removed entirely and the text frame wrapping behavior to be inherited
     from a parent element.
     """
     value_map = {'square': True, 'none': False, None: None}
     bodyPr = get_or_add(self._txBody, 'a:bodyPr')
     value = bodyPr.get('wrap')
     return value_map[value]
Esempio n. 4
0
 def it_creates_a_new_child_if_one_is_not_present(self, parent_elm):
     child_elm = get_or_add(parent_elm, 'p:baz')
     assert child_elm.tag == qn('p:baz')
     assert child_elm.getparent() is parent_elm
Esempio n. 5
0
 def it_returns_a_matching_child_if_present(
         self, parent_elm, known_child_nsptag_str, known_child_elm):
     child_elm = get_or_add(parent_elm, known_child_nsptag_str)
     assert child_elm is known_child_elm