From e9008f8dfaa032df4c98f18bb4fa917140550c6a Mon Sep 17 00:00:00 2001 From: jmpla Date: Fri, 26 May 2023 07:19:25 +0200 Subject: [PATCH] wip --- app/but/prepajury_desc.py | 15 +++++++++++++-- app/but/prepajury_xl_format.py | 19 ++++++++++--------- 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/app/but/prepajury_desc.py b/app/but/prepajury_desc.py index 9395c9291..ca1021e9d 100644 --- a/app/but/prepajury_desc.py +++ b/app/but/prepajury_desc.py @@ -226,6 +226,18 @@ class ParcoursDesc: self, ws: ScoExcelSheet, description: tuple, row: int, column: int ) -> int: title, content_list = description + frame_thickness, frame_color = [ + (SCO_BORDERTHICKNESS.BORDER_THICK, SCO_COLORS.BLACK), + (SCO_BORDERTHICKNESS.BORDER_THIN, SCO_COLORS.BLUE), + (SCO_BORDERTHICKNESS.BORDER_HAIR, SCO_COLORS.GREEN), + (SCO_BORDERTHICKNESS.NONE, SCO_COLORS.NONE), + ][row - 1] + frame = ws.get_frame_engine( + start_row=row, + start_column=column, + thickness=frame_thickness, + color=frame_color, + ) ws.set_cell( row=row, column=column, @@ -241,6 +253,7 @@ class ParcoursDesc: for content in content_list: column = self.handle_description(ws, content, row + 1, column) merge_h.close(end_column=column - 1) + frame.close(4, column - 1) return column def generate_etudiant_header(self, ws: ScoExcelSheet) -> int: @@ -263,9 +276,7 @@ class ParcoursDesc: ), ], ) - frame = ws.get_frame_engine(1, 1, SCO_BORDERTHICKNESS.BORDER_THICK) column = self.handle_description(ws, titles, 1, 1) - frame.close(4, column - 1) return column def generate_header(self, ws: ScoExcelSheet): diff --git a/app/but/prepajury_xl_format.py b/app/but/prepajury_xl_format.py index 3d1a51f61..13c05880b 100644 --- a/app/but/prepajury_xl_format.py +++ b/app/but/prepajury_xl_format.py @@ -25,15 +25,16 @@ class SCO_COLORS(Enum): BLUE = (6, "FF0000FF") ORANGE = (7, "FFFF3300") LIGHT_YELLOW = (8, "FFFFFF99") - BUT1 = (9, "FF95B3D7") - RCUE1 = (10, "FFB8CCE4") - UE1 = (11, "FFDCE6F1") - BUT2 = (12, "FFC4D79B") - RCUE2 = (13, "FFD8E4BC") - UE2 = (14, "FFEBF1DE") - BUT3 = (15, "FFFABF8F") - RCUE3 = (16, "FFFCD5B4") - UE3 = (17, "FFFDE9D9") + GREEN = (9, "FF00FF00") + BUT1 = (23, "FF95B3D7") + RCUE1 = (24, "FFB8CCE4") + UE1 = (25, "FFDCE6F1") + BUT2 = (26, "FFC4D79B") + RCUE2 = (27, "FFD8E4BC") + UE2 = (28, "FFEBF1DE") + BUT3 = (29, "FFFABF8F") + RCUE3 = (30, "FFFCD5B4") + UE3 = (31, "FFFDE9D9") class SCO_BORDERTHICKNESS(Enum):