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

Function register_element_cls

src/pptx/oxml/__init__.py:39–46  ·  view source on GitHub ↗

Register `cls` to be constructed when oxml parser encounters element having `nsptag_name`. `nsptag_name` is a string of the form `nspfx:tagroot`, e.g. `"w:document"`.

(nsptagname: str, cls: Type[BaseOxmlElement])

Source from the content-addressed store, hash-verified

37
38
39def register_element_cls(nsptagname: str, cls: Type[BaseOxmlElement]):
40 """Register `cls` to be constructed when oxml parser encounters element having `nsptag_name`.
41
42 `nsptag_name` is a string of the form `nspfx:tagroot`, e.g. `"w:document"`.
43 """
44 nsptag = NamespacePrefixedTag(nsptagname)
45 namespace = element_class_lookup.get_namespace(nsptag.nsuri)
46 namespace[nsptag.local_part] = cls
47
48
49from pptx.oxml.action import CT_Hyperlink # noqa: E402

Calls 1

Used in the wild real call sites across dependent graphs

searching dependent graphs…