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

Method _get_boolean_property

src/pptx/oxml/table.py:139–149  ·  view source on GitHub ↗

Generalized getter for the boolean properties on the `a:tblPr` child element. Defaults to False if `propname` attribute is missing or `a:tblPr` element itself is not present.

(self, propname: str)

Source from the content-addressed store, hash-verified

137 return self.tr_lst[row_idx].tc_lst[col_idx]
138
139 def _get_boolean_property(self, propname: str) -> bool:
140 """Generalized getter for the boolean properties on the `a:tblPr` child element.
141
142 Defaults to False if `propname` attribute is missing or `a:tblPr` element itself is not
143 present.
144 """
145 tblPr = self.tblPr
146 if tblPr is None:
147 return False
148 propval = getattr(tblPr, propname)
149 return {True: True, False: False, None: False}[propval]
150
151 def _set_boolean_property(self, propname: str, value: bool) -> None:
152 """Generalized setter for boolean properties on the `a:tblPr` child element.

Callers 6

bandColMethod · 0.95
bandRowMethod · 0.95
firstColMethod · 0.95
firstRowMethod · 0.95
lastColMethod · 0.95
lastRowMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected