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

Method new

src/docx/oxml/shape.py:80–90  ·  view source on GitHub ↗

Return a new `` `` element populated with the values passed as parameters.

(cls, cx: Length, cy: Length, shape_id: int, pic: CT_Picture)

Source from the content-addressed store, hash-verified

78
79 @classmethod
80 def new(cls, cx: Length, cy: Length, shape_id: int, pic: CT_Picture) -> CT_Inline:
81 """Return a new ``<wp:inline>`` element populated with the values passed as
82 parameters."""
83 inline = cast(CT_Inline, parse_xml(cls._inline_xml()))
84 inline.extent.cx = cx
85 inline.extent.cy = cy
86 inline.docPr.id = shape_id
87 inline.docPr.name = "Picture %d" % shape_id
88 inline.graphic.graphicData.uri = "http://schemas.openxmlformats.org/drawingml/2006/picture"
89 inline.graphic.graphicData._insert_pic(pic)
90 return inline
91
92 @classmethod
93 def new_pic_inline(

Callers 1

new_pic_inlineMethod · 0.45

Calls 2

parse_xmlFunction · 0.90
_inline_xmlMethod · 0.80

Tested by

no test coverage detected