in src-python/trp/__init__.py [0:0]
def __init__(self, block, blockMap):
super().__init__(block, blockMap)
self._rows: List[Row] = []
if ('Relationships' in block and block['Relationships']):
for rs in block['Relationships']:
if (rs['Type'] == 'CHILD'):
cells: List[Cell] = list()
for cid in rs['Ids']:
cell = Cell(blockMap[cid], blockMap)
cells.append(cell)
cells.sort(key=lambda cell: (cell.rowIndex, cell.columnIndex))
for row_index in range(1, max([x.rowIndex for x in cells])):
new_row: Row = Row()
new_row.cells = [x for x in cells if x.rowIndex == row_index]
self._rows.append(new_row)