Add a row to the table. All items are converted to strings. @type row: tuple @keyword row: Each argument is a cell in the table.
(self, *row)
| 1085 | self.__sep = sep |
| 1086 | |
| 1087 | def addRow(self, *row): |
| 1088 | """ |
| 1089 | Add a row to the table. All items are converted to strings. |
| 1090 | |
| 1091 | @type row: tuple |
| 1092 | @keyword row: Each argument is a cell in the table. |
| 1093 | """ |
| 1094 | row = [str(item) for item in row] |
| 1095 | len_row = [len(item) for item in row] |
| 1096 | width = self.__width |
| 1097 | len_old = len(width) |
| 1098 | len_new = len(row) |
| 1099 | known = min(len_old, len_new) |
| 1100 | missing = len_new - len_old |
| 1101 | if missing > 0: |
| 1102 | width.extend(len_row[-missing:]) |
| 1103 | elif missing < 0: |
| 1104 | len_row.extend([0] * (-missing)) |
| 1105 | self.__width = [max(width[i], len_row[i]) for i in compat.xrange(len(len_row))] |
| 1106 | self.__cols.append(row) |
| 1107 | |
| 1108 | def justify(self, column, direction): |
| 1109 | """ |
no test coverage detected