Ejemplo n.º 1
0
 def numbering_part(self):
     """
     Instance of |NumberingPart| for this document. Creates an empty
     numbering part if one is not present.
     """
     try:
         return self._document_part.part_related_by(RT.NUMBERING)
     except KeyError:
         numbering_part = NumberingPart.new()
         self._document_part.relate_to(numbering_part, RT.NUMBERING)
         return numbering_part
Ejemplo n.º 2
0
 def numbering_part(self):
     """
     A |NumberingPart| object providing access to the numbering
     definitions for this document. Creates an empty numbering part if one
     is not present.
     """
     try:
         return self.part_related_by(RT.NUMBERING)
     except KeyError:
         numbering_part = NumberingPart.new()
         self.relate_to(numbering_part, RT.NUMBERING)
         return numbering_part
Ejemplo n.º 3
0
 def it_can_be_constructed_by_opc_part_factory(self, construct_fixture):
     (partname_, content_type_, blob_, package_, oxml_fromstring_,
      init__, numbering_elm_) = construct_fixture
     # exercise ---------------------
     numbering_part = NumberingPart.load(
         partname_, content_type_, blob_, package_
     )
     # verify -----------------------
     oxml_fromstring_.assert_called_once_with(blob_)
     init__.assert_called_once_with(
         partname_, content_type_, numbering_elm_, package_
     )
     assert isinstance(numbering_part, NumberingPart)