forked from ScoDoc/ScoDoc
27 lines
622 B
Python
27 lines
622 B
Python
|
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
|