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

Method _add_creator

src/pptx/oxml/xmlchemy.py:311–321  ·  view source on GitHub ↗

Add a `_new_{prop_name}()` method to the element class. This method creates a new, empty element of the correct type, having no attributes.

(self)

Source from the content-addressed store, hash-verified

309 self._add_to_class(self._add_method_name, _add_child)
310
311 def _add_creator(self):
312 """Add a `_new_{prop_name}()` method to the element class.
313
314 This method creates a new, empty element of the correct type, having no attributes.
315 """
316 creator = self._creator
317 creator.__doc__ = (
318 'Return a "loose", newly created ``<%s>`` element having no attri'
319 "butes, text, or children." % self._nsptagname
320 )
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.

Callers 4

Calls 1

_add_to_classMethod · 0.95

Tested by

no test coverage detected