MCPcopy
hub / github.com/pallets/click / measure_table

Function measure_table

src/click/formatting.py:14–21  ·  view source on GitHub ↗
(rows: cabc.Iterable[tuple[str, str]])

Source from the content-addressed store, hash-verified

12
13
14def measure_table(rows: cabc.Iterable[tuple[str, str]]) -> tuple[int, ...]:
15 widths: dict[int, int] = {}
16
17 for row in rows:
18 for idx, col in enumerate(row):
19 widths[idx] = max(widths.get(idx, 0), term_len(col))
20
21 return tuple(y for x, y in sorted(widths.items()))
22
23
24def iter_rows(

Callers 1

write_dlMethod · 0.85

Calls 1

term_lenFunction · 0.85

Tested by

no test coverage detected