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

Method new

src/docx/oxml/shape.py:147–155  ·  view source on GitHub ↗

A new minimum viable ` ` (picture) element.

(cls, pic_id: int, filename: str, rId: str, cx: Length, cy: Length)

Source from the content-addressed store, hash-verified

145
146 @classmethod
147 def new(cls, pic_id: int, filename: str, rId: str, cx: Length, cy: Length) -> CT_Picture:
148 """A new minimum viable `<pic:pic>` (picture) element."""
149 pic = parse_xml(cls._pic_xml())
150 pic.nvPicPr.cNvPr.id = pic_id
151 pic.nvPicPr.cNvPr.name = filename
152 pic.blipFill.blip.embed = rId
153 pic.spPr.cx = cx
154 pic.spPr.cy = cy
155 return pic
156
157 @classmethod
158 def _pic_xml(cls):

Callers

nothing calls this directly

Calls 2

parse_xmlFunction · 0.90
_pic_xmlMethod · 0.80

Tested by

no test coverage detected