MCPcopy Create free account
hub / github.com/scanny/python-pptx / new

Method new

src/pptx/opc/oxml.py:108–120  ·  view source on GitHub ↗

Return a new ` ` element. `target_ref` is either a partname or a URI.

(
        cls, rId: str, reltype: str, target_ref: str, target_mode: str = RTM.INTERNAL
    )

Source from the content-addressed store, hash-verified

106
107 @classmethod
108 def new(
109 cls, rId: str, reltype: str, target_ref: str, target_mode: str = RTM.INTERNAL
110 ) -> CT_Relationship:
111 """Return a new `<Relationship>` element.
112
113 `target_ref` is either a partname or a URI.
114 """
115 relationship = cast(CT_Relationship, parse_xml(f'<Relationship xmlns="{nsmap["pr"]}"/>'))
116 relationship.rId = rId
117 relationship.reltype = reltype
118 relationship.target_ref = target_ref
119 relationship.targetMode = target_mode
120 return relationship
121
122
123class CT_Relationships(BaseOxmlElement):

Callers

nothing calls this directly

Calls 1

parse_xmlFunction · 0.90

Tested by

no test coverage detected