Ejemplo n.º 1
0
 def _get_alignment(self):
     """
     Return alignment type of this paragraph, e.g. ``PP.ALIGN_CENTER``.
     Can return |None|, meaning the paragraph has no alignment setting and
     its effective value is inherited from a higher-level object.
     """
     algn = self.__p.get_algn()
     return ParagraphAlignment.from_text_align_type(algn)
Ejemplo n.º 2
0
 def alignment(self):
     """
     Horizontal alignment of this paragraph, represented by a constant
     value like ``PP.ALIGN_CENTER``. Its value can be |None|, meaning the
     paragraph has no alignment setting and its effective value is
     inherited from a higher-level object.
     """
     return ParagraphAlignment.from_text_align_type(self._pPr.algn)
Ejemplo n.º 3
0
 def test_from_text_align_type_return_value(self):
     """ParagraphAlignment.from_text_align_type() returns correct value"""
     # verify -----------------------
     for alignment, text_align_type in self.cases:
         assert_that(
             ParagraphAlignment.from_text_align_type(text_align_type),
             is_(equal_to(alignment))
         )
Ejemplo n.º 4
0
 def _get_alignment(self):
     """
     Return alignment type of this paragraph, e.g. ``PP.ALIGN_CENTER``.
     Can return |None|, meaning the paragraph has no alignment setting and
     its effective value is inherited from a higher-level object.
     """
     algn = self.__p.get_algn()
     return ParagraphAlignment.from_text_align_type(algn)
Ejemplo n.º 5
0
 def test_from_text_align_type_raises_on_bad_key(self):
     """ParagraphAlignment.from_text_align_type raises on bad key"""
     with self.assertRaises(KeyError):
         ParagraphAlignment.from_text_align_type('foobar')