ScoDoc-Lille/app/but/prepajury_cells.py

27 lines
622 B
Python
Raw Normal View History

2023-05-09 07:32:49 +02:00
from enum import Enum
from app.but.prepajury_xl import ScoExcelSheet, excel_make_style
base_style = excel_make_style()
class BG(Enum):
NONE = 0,
BLACK = 1,
GREY = 2,
BUT1
class Cell:
def __init__(self, text: str = None, style: int = None, comment: str = None):
self.text = text
self.style = style or base_style
self.comment = comment
@staticmethod
def get_style():
return base_style
def make_cell(self, worksheet: ScoExcelSheet):
style = self.get_style()
cell = worksheet.make_cell(self.text or "", style=style)
return cell