Add a row to the table. Input must be a list where each entry corresponds to its respective column in order.
(self, row)
| 330 | return (len(self.table), len(self.table[0])) |
| 331 | |
| 332 | def add_row(self, row): |
| 333 | """ |
| 334 | Add a row to the table. Input must be a list where each entry |
| 335 | corresponds to its respective column in order. |
| 336 | """ |
| 337 | if len(row) != len(self.table[0]): |
| 338 | raise CLIException("Number of entries and columns do not match!") |
| 339 | |
| 340 | # Adjust padding for each column. |
| 341 | for index, elem in enumerate(row): |
| 342 | if len(elem) > self.padding[index]: |
| 343 | self.padding[index] = len(elem) |
| 344 | |
| 345 | self.table.append(row) |
| 346 | |
| 347 | def __str__(self): |
| 348 | """ |