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

Method new

src/docx/parts/hdrftr.py:40–45  ·  view source on GitHub ↗

Return newly created header part.

(cls, package: Package)

Source from the content-addressed store, hash-verified

38
39 @classmethod
40 def new(cls, package: Package):
41 """Return newly created header part."""
42 partname = package.next_partname("/word/header%d.xml")
43 content_type = CT.WML_HEADER
44 element = parse_xml(cls._default_header_xml())
45 return cls(partname, content_type, element, package)
46
47 @classmethod
48 def _default_header_xml(cls):

Callers

nothing calls this directly

Calls 3

parse_xmlFunction · 0.90
next_partnameMethod · 0.80
_default_header_xmlMethod · 0.80

Tested by

no test coverage detected