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

Method _add_getter

src/pptx/oxml/xmlchemy.py:323–330  ·  view source on GitHub ↗

Add a read-only `{prop_name}` property to the parent element class. The property locates and returns this child element or `None` if not present.

(self)

Source from the content-addressed store, hash-verified

321 self._add_to_class(self._new_method_name, creator)
322
323 def _add_getter(self):
324 """Add a read-only `{prop_name}` property to the parent element class.
325
326 The property locates and returns this child element or `None` if not present.
327 """
328 property_ = property(self._getter, None, None)
329 # assign unconditionally to overwrite element name definition
330 setattr(self._element_cls, self._prop_name, property_)
331
332 def _add_inserter(self):
333 """Add an ``_insert_x()`` method to the element class for this child element."""

Callers 3

Calls

no outgoing calls

Tested by

no test coverage detected