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

Class CT_CommonSlideData

src/pptx/oxml/slide.py:91–126  ·  view source on GitHub ↗

`p:cSld` element.

Source from the content-addressed store, hash-verified

89
90
91class CT_CommonSlideData(BaseOxmlElement):
92 """`p:cSld` element."""
93
94 _remove_bg: Callable[[], None]
95 get_or_add_bg: Callable[[], CT_Background]
96
97 _tag_seq = ("p:bg", "p:spTree", "p:custDataLst", "p:controls", "p:extLst")
98 bg: CT_Background | None = ZeroOrOne( # pyright: ignore[reportAssignmentType]
99 "p:bg", successors=_tag_seq[1:]
100 )
101 spTree: CT_GroupShape = OneAndOnlyOne("p:spTree") # pyright: ignore[reportAssignmentType]
102 del _tag_seq
103 name: str = OptionalAttribute( # pyright: ignore[reportAssignmentType]
104 "name", XsdString, default=""
105 )
106
107 def get_or_add_bgPr(self) -> CT_BackgroundProperties:
108 """Return `p:bg/p:bgPr` grandchild.
109
110 If no such grandchild is present, any existing `p:bg` child is first removed and a new
111 default `p:bg` with noFill settings is added.
112 """
113 bg = self.bg
114 if bg is None or bg.bgPr is None:
115 bg = self._change_to_noFill_bg()
116 return cast(CT_BackgroundProperties, bg.bgPr)
117
118 def _change_to_noFill_bg(self) -> CT_Background:
119 """Establish a `p:bg` child with no-fill settings.
120
121 Any existing `p:bg` child is first removed.
122 """
123 self._remove_bg()
124 bg = self.get_or_add_bg()
125 bg.add_noFill_bgPr()
126 return bg
127
128
129class CT_NotesMaster(_BaseSlideElement):

Callers

nothing calls this directly

Calls 3

ZeroOrOneClass · 0.90
OneAndOnlyOneClass · 0.90
OptionalAttributeClass · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…