Sequence of table rows
| 473 | |
| 474 | |
| 475 | class _RowCollection(Subshape): |
| 476 | """Sequence of table rows""" |
| 477 | |
| 478 | def __init__(self, tbl: CT_Table, parent: Table): |
| 479 | super(_RowCollection, self).__init__(parent) |
| 480 | self._parent = parent |
| 481 | self._tbl = tbl |
| 482 | |
| 483 | def __getitem__(self, idx: int) -> _Row: |
| 484 | """Provides indexed access, (e.g. 'rows[0]').""" |
| 485 | if idx < 0 or idx >= len(self): |
| 486 | msg = "row index [%d] out of range" % idx |
| 487 | raise IndexError(msg) |
| 488 | return _Row(self._tbl.tr_lst[idx], self) |
| 489 | |
| 490 | def __len__(self): |
| 491 | """Supports len() function (e.g. 'len(rows) == 1').""" |
| 492 | return len(self._tbl.tr_lst) |
| 493 | |
| 494 | def notify_height_changed(self): |
| 495 | """Called by a row when its height changes. Pass along to parent.""" |
| 496 | self._parent.notify_height_changed() |
no outgoing calls
searching dependent graphs…