This commit is contained in:
Jean-Marie Place 2023-05-26 07:19:25 +02:00
parent d912b13f75
commit e9008f8dfa
2 changed files with 23 additions and 11 deletions

View File

@ -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):

View File

@ -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):