コード例 #1
0
 def it_can_construct_a_default_styles_part_to_help(self):
     package = OpcPackage()
     styles_part = StylesPart.default(package)
     assert isinstance(styles_part, StylesPart)
     assert styles_part.partname == '/word/styles.xml'
     assert styles_part.content_type == CT.WML_STYLES
     assert styles_part.package is package
     assert len(styles_part.element) == 6
コード例 #2
0
ファイル: test_styles.py プロジェクト: 74n3r/python-docx
 def it_can_construct_a_default_styles_part_to_help(self):
     package = OpcPackage()
     styles_part = StylesPart.default(package)
     assert isinstance(styles_part, StylesPart)
     assert styles_part.partname == '/word/styles.xml'
     assert styles_part.content_type == CT.WML_STYLES
     assert styles_part.package is package
     assert len(styles_part.element) == 6
コード例 #3
0
ファイル: document.py プロジェクト: Elmlea/phraseFinder
 def _styles_part(self):
     """
     Instance of |StylesPart| for this document. Creates an empty styles
     part if one is not present.
     """
     try:
         return self.part_related_by(RT.STYLES)
     except KeyError:
         styles_part = StylesPart.default(self.package)
         self.relate_to(styles_part, RT.STYLES)
         return styles_part
コード例 #4
0
ファイル: document.py プロジェクト: madphysicist/python-docx
 def _styles_part(self):
     """
     Instance of |StylesPart| for this document. Creates an empty styles
     part if one is not present.
     """
     try:
         return self.part_related_by(RT.STYLES)
     except KeyError:
         styles_part = StylesPart.default(self.package)
         self.relate_to(styles_part, RT.STYLES)
         return styles_part