Release standalone PPT template workflow 0.5.0

This commit is contained in:
2026-10-10 21:02:47 +08:00
commit 4e3271ff62
303 changed files with 190946 additions and 0 deletions
@@ -0,0 +1,21 @@
#!/usr/bin/env python3
"""Safety checks for opaque DrawingML fragments copied between PPTX parts."""
from __future__ import annotations
from xml.etree import ElementTree as ET
RELATIONSHIPS_NS = (
"http://schemas.openxmlformats.org/officeDocument/2006/relationships"
)
_RELATIONSHIP_ATTRIBUTE_PREFIX = f"{{{RELATIONSHIPS_NS}}}"
def has_relationship_attributes(root: ET.Element) -> bool:
"""Return whether a subtree contains any part-local relationship QName."""
return any(
attribute.startswith(_RELATIONSHIP_ATTRIBUTE_PREFIX)
for element in root.iter()
for attribute in element.attrib
)