MCPcopy Index your code
hub / github.com/SourceCode-AI/aura / print_tables

Method print_tables

aura/output/text.py:154–179  ·  view source on GitHub ↗
(self, *tables)

Source from the content-addressed store, hash-verified

152 return " " * (remaining_len - content_len) + text
153
154 def print_tables(self, *tables):
155 table_widths = [t.width+2 for t in tables]
156
157 self.print_top_separator()
158
159 titles = [t.metadata.get("title", "N/A") for t in tables]
160 tparts = [tuple(self.generate_heading(title, width=w, left="", right="") for w, title in zip(table_widths, titles))]
161
162 for idx, rows in enumerate(itertools.zip_longest(*tables, fillvalue="")):
163
164 full_row = []
165
166 for ridx, row in enumerate(rows):
167 text = " \u2506 ".join(self._align_text(c.pretty, width=tables[ridx].col_len[cidx]) for cidx, c in enumerate(row))
168 text = self._align_text(text, width=table_widths[ridx]+2)
169
170 full_row.append(text)
171
172 tparts.append(full_row)
173
174 for idx, tpart in enumerate(tparts):
175 self.align(" \u2551 ".join(tpart))
176 if idx == 0:
177 self.print_thick_separator()
178
179 self.print_bottom_separator()
180
181
182

Callers 3

output_typosquattingMethod · 0.95
output_diffMethod · 0.95
pprintMethod · 0.95

Calls 8

print_top_separatorMethod · 0.95
generate_headingMethod · 0.95
_align_textMethod · 0.95
alignMethod · 0.95
print_thick_separatorMethod · 0.95
getMethod · 0.80
joinMethod · 0.80

Tested by

no test coverage detected