Sequence of |SlideMaster| objects belonging to a presentation. Has list access semantics, supporting indexed access, len(), and iteration.
| 427 | |
| 428 | |
| 429 | class SlideMasters(ParentedElementProxy): |
| 430 | """Sequence of |SlideMaster| objects belonging to a presentation. |
| 431 | |
| 432 | Has list access semantics, supporting indexed access, len(), and iteration. |
| 433 | """ |
| 434 | |
| 435 | part: PresentationPart # pyright: ignore[reportIncompatibleMethodOverride] |
| 436 | |
| 437 | def __init__(self, sldMasterIdLst: CT_SlideMasterIdList, parent: Presentation): |
| 438 | super(SlideMasters, self).__init__(sldMasterIdLst, parent) |
| 439 | self._sldMasterIdLst = sldMasterIdLst |
| 440 | |
| 441 | def __getitem__(self, idx: int) -> SlideMaster: |
| 442 | """Provides indexed access, e.g. `slide_masters[2]`.""" |
| 443 | try: |
| 444 | sldMasterId = self._sldMasterIdLst.sldMasterId_lst[idx] |
| 445 | except IndexError: |
| 446 | raise IndexError("slide master index out of range") |
| 447 | return self.part.related_slide_master(sldMasterId.rId) |
| 448 | |
| 449 | def __iter__(self): |
| 450 | """Generate each |SlideMaster| instance in the collection, in sequence.""" |
| 451 | for smi in self._sldMasterIdLst.sldMasterId_lst: |
| 452 | yield self.part.related_slide_master(smi.rId) |
| 453 | |
| 454 | def __len__(self): |
| 455 | """Support len() built-in function, e.g. `len(slide_masters) == 4`.""" |
| 456 | return len(self._sldMasterIdLst) |
| 457 | |
| 458 | |
| 459 | class _Background(ElementProxy): |
no outgoing calls
searching dependent graphs…