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

Method _add_to_class

src/pptx/oxml/xmlchemy.py:358–362  ·  view source on GitHub ↗

Add `method` to the target class as `name`, unless `name` is already defined there.

(self, name: str, method: Callable[..., Any])

Source from the content-addressed store, hash-verified

356 return "_add_%s" % self._prop_name
357
358 def _add_to_class(self, name: str, method: Callable[..., Any]):
359 """Add `method` to the target class as `name`, unless `name` is already defined there."""
360 if hasattr(self._element_cls, name):
361 return
362 setattr(self._element_cls, name, method)
363
364 @property
365 def _creator(self) -> Callable[[BaseOxmlElement], BaseOxmlElement]:

Callers 8

_add_adderMethod · 0.95
_add_creatorMethod · 0.95
_add_inserterMethod · 0.95
_add_public_adderMethod · 0.80
_add_get_or_adderMethod · 0.80
_add_removerMethod · 0.80
_add_group_removerMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected