MCPcopy Create free account
hub / github.com/astanin/python-tabulate / _rst_escape_first_column

Function _rst_escape_first_column

tabulate/__init__.py:343–359  ·  view source on GitHub ↗
(rows, headers)

Source from the content-addressed store, hash-verified

341
342
343def _rst_escape_first_column(rows, headers):
344 def escape_empty(val):
345 if isinstance(val, (str, bytes)) and not val.strip():
346 return ".."
347 else:
348 return val
349
350 new_headers = list(headers)
351 new_rows = []
352 if headers:
353 new_headers[0] = escape_empty(headers[0])
354 for row in rows:
355 new_row = list(row)
356 if new_row:
357 new_row[0] = escape_empty(row[0])
358 new_rows.append(new_row)
359 return new_rows, new_headers
360
361
362_table_formats = {

Callers 1

tabulateFunction · 0.85

Calls 1

escape_emptyFunction · 0.85

Tested by

no test coverage detected