Generalized setter for boolean properties on the `a:tblPr` child element. Sets `propname` attribute appropriately based on `value`. If `value` is True, the attribute is set to "1"; a tblPr child element is added if necessary. If `value` is False, the `propname` attribute is
(self, propname: str, value: bool)
| 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. |
| 153 | |
| 154 | Sets `propname` attribute appropriately based on `value`. If `value` is True, the |
| 155 | attribute is set to "1"; a tblPr child element is added if necessary. If `value` is False, |
| 156 | the `propname` attribute is removed if present, allowing its default value of False to be |
| 157 | its effective value. |
| 158 | """ |
| 159 | if value not in (True, False): |
| 160 | raise ValueError("assigned value must be either True or False, got %s" % value) |
| 161 | tblPr = self.get_or_add_tblPr() |
| 162 | setattr(tblPr, propname, value) |
| 163 | |
| 164 | @classmethod |
| 165 | def _tbl_tmpl(cls): |