This commit is contained in:
2026-02-13 13:45:35 -08:00
parent 6416aeceec
commit ce2f28cc50
5 changed files with 99 additions and 24 deletions

View File

@@ -12,6 +12,11 @@ import logging
logger = logging.getLogger(__name__)
from SYS.result_table import (
RESULT_TABLE_BORDER_STYLE,
RESULT_TABLE_HEADER_STYLE,
get_result_table_row_style,
)
from SYS.result_table_api import ColumnSpec, ResultModel, ResultTable, Renderer
@@ -30,12 +35,16 @@ class RichRenderer(Renderer):
except Exception as exc:
raise RuntimeError("rich is required for RichRenderer") from exc
table = RichTable(show_header=True, header_style="bold")
table = RichTable(
show_header=True,
header_style=RESULT_TABLE_HEADER_STYLE,
border_style=RESULT_TABLE_BORDER_STYLE,
)
cols = list(columns)
for col in cols:
table.add_column(col.header)
for r in rows:
for row_idx, r in enumerate(rows):
cells = []
for col in cols:
try:
@@ -52,7 +61,7 @@ class RichRenderer(Renderer):
logger.exception("Column extractor failed for '%s': %s", col.header, exc)
cell = ""
cells.append(cell)
table.add_row(*cells)
table.add_row(*cells, style=get_result_table_row_style(row_idx))
return table