Method: pylint.reporters.ureports.base_writer.BaseWriter.get_table_content
Calls: 10, Exceptions: 0, Paths: 1Back
Path 1: 10 calls (1.0)
Table (10)
list (10)
1def get_table_content(self, table: Table) -> list[list[str]]:
2 """Trick to get table content without actually writing it.
3
4 return an aligned list of lists containing table cells values as string
5 """
6 result: list[list[str]] = [[]]
7 cols = table.cols
8 for cell in self.compute_content(table):
9 if cols == 0:
10 result.append([])
11 cols = table.cols
12 cols -= 1
13 result[-1].append(cell)
14 # fill missing cells
15 result[-1] += [""] * (cols - len(result[-1]))
16 return result