MCPcopy Index your code
hub / github.com/python-openxml/python-docx / _settings_part

Method _settings_part

src/docx/parts/document.py:143–154  ·  view source on GitHub ↗

A |SettingsPart| object providing access to the document-level settings for this document. Creates a default settings part if one is not present.

(self)

Source from the content-addressed store, hash-verified

141
142 @property
143 def _settings_part(self) -> SettingsPart:
144 """A |SettingsPart| object providing access to the document-level settings for
145 this document.
146
147 Creates a default settings part if one is not present.
148 """
149 try:
150 return cast(SettingsPart, self.part_related_by(RT.SETTINGS))
151 except KeyError:
152 settings_part = SettingsPart.default(self.package)
153 self.relate_to(settings_part, RT.SETTINGS)
154 return settings_part
155
156 @property
157 def _styles_part(self) -> StylesPart:

Callers

nothing calls this directly

Calls 3

part_related_byMethod · 0.45
defaultMethod · 0.45
relate_toMethod · 0.45

Tested by

no test coverage detected