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

Class _RowCollection

src/pptx/table.py:475–496  ·  view source on GitHub ↗

Sequence of table rows

Source from the content-addressed store, hash-verified

473
474
475class _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()

Callers 5

getitem_fixtureMethod · 0.90
iter_fixtureMethod · 0.90
len_fixtureMethod · 0.90
rowsMethod · 0.85

Calls

no outgoing calls

Tested by 4

getitem_fixtureMethod · 0.72
iter_fixtureMethod · 0.72
len_fixtureMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…