Generate the text output for the table. @rtype: generator of str @return: Text output.
(self)
| 1151 | return "%s\n" % "\n".join(self.yieldOutput()) |
| 1152 | |
| 1153 | def yieldOutput(self): |
| 1154 | """ |
| 1155 | Generate the text output for the table. |
| 1156 | |
| 1157 | @rtype: generator of str |
| 1158 | @return: Text output. |
| 1159 | """ |
| 1160 | width = self.__width |
| 1161 | if width: |
| 1162 | num_cols = len(width) |
| 1163 | fmt = ["%%%ds" % -w for w in width] |
| 1164 | if width[-1] > 0: |
| 1165 | fmt[-1] = "%s" |
| 1166 | fmt = self.__sep.join(fmt) |
| 1167 | for row in self.__cols: |
| 1168 | row.extend([""] * (num_cols - len(row))) |
| 1169 | yield fmt % tuple(row) |
| 1170 | |
| 1171 | def show(self): |
| 1172 | """ |