mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-30 13:10:47 +00:00
Wire _apply_section_borders into headers and data rows; consolidate constants 🟪
This commit is contained in:
parent
2801756e56
commit
3eaf2011b0
1 changed files with 5 additions and 7 deletions
|
|
@ -15,6 +15,9 @@ _HEADER_FILL = PatternFill("solid", fgColor="D9D9D9")
|
||||||
_FLOOR_FILL = PatternFill("solid", fgColor="BDD7EE")
|
_FLOOR_FILL = PatternFill("solid", fgColor="BDD7EE")
|
||||||
_BOLD = Font(bold=True)
|
_BOLD = Font(bold=True)
|
||||||
_TOTAL_COLS = 25 # A–Y
|
_TOTAL_COLS = 25 # A–Y
|
||||||
|
_BLANK_SEPARATOR_COLS = {5, 21}
|
||||||
|
_MEDIUM_RIGHT = Border(right=Side(style="medium"))
|
||||||
|
_SECTION_BOUNDARY_COLS = {4, 11, 15, 20}
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
|
|
@ -82,13 +85,6 @@ def _build_rows(plan: Plan) -> list[AuditRow]:
|
||||||
return rows
|
return rows
|
||||||
|
|
||||||
|
|
||||||
_BLANK_SEPARATOR_COLS = {5, 21}
|
|
||||||
|
|
||||||
|
|
||||||
_MEDIUM_RIGHT = Border(right=Side(style="medium"))
|
|
||||||
_SECTION_BOUNDARY_COLS = {4, 11, 15, 20}
|
|
||||||
|
|
||||||
|
|
||||||
def _apply_section_borders(ws: Worksheet, row: int) -> None:
|
def _apply_section_borders(ws: Worksheet, row: int) -> None:
|
||||||
for col in _SECTION_BOUNDARY_COLS:
|
for col in _SECTION_BOUNDARY_COLS:
|
||||||
ws.cell(row=row, column=col).border = _MEDIUM_RIGHT
|
ws.cell(row=row, column=col).border = _MEDIUM_RIGHT
|
||||||
|
|
@ -134,6 +130,7 @@ def _write_headers(ws: Worksheet) -> None:
|
||||||
for col in range(1, _TOTAL_COLS + 1):
|
for col in range(1, _TOTAL_COLS + 1):
|
||||||
if col not in _BLANK_SEPARATOR_COLS:
|
if col not in _BLANK_SEPARATOR_COLS:
|
||||||
ws.cell(row=row, column=col).fill = _HEADER_FILL
|
ws.cell(row=row, column=col).fill = _HEADER_FILL
|
||||||
|
_apply_section_borders(ws, row)
|
||||||
|
|
||||||
|
|
||||||
def _write_data_rows(ws: Worksheet, rows: list[AuditRow]) -> None:
|
def _write_data_rows(ws: Worksheet, rows: list[AuditRow]) -> None:
|
||||||
|
|
@ -162,6 +159,7 @@ def _write_data_rows(ws: Worksheet, rows: list[AuditRow]) -> None:
|
||||||
ws.cell(row=xl_row, column=11, value=row.window_opening_type)
|
ws.cell(row=xl_row, column=11, value=row.window_opening_type)
|
||||||
ws.cell(row=xl_row, column=22, value=row.door_location)
|
ws.cell(row=xl_row, column=22, value=row.door_location)
|
||||||
ws.cell(row=xl_row, column=23, value=row.door_width_mm)
|
ws.cell(row=xl_row, column=23, value=row.door_width_mm)
|
||||||
|
_apply_section_borders(ws, xl_row)
|
||||||
xl_row += 1
|
xl_row += 1
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue