Skip to content
Snippets Groups Projects
Commit 8bd92fd7 authored by Emmanuel Viennet's avatar Emmanuel Viennet
Browse files

Code cleaning

parent 8ddab219
Branches
No related tags found
No related merge requests found
...@@ -53,6 +53,7 @@ from app.scodoc import notesdb, sco_preferences ...@@ -53,6 +53,7 @@ from app.scodoc import notesdb, sco_preferences
class COLORS(Enum): class COLORS(Enum):
"Couleurs de base pour les styles excel"
BLACK = "FF000000" BLACK = "FF000000"
WHITE = "FFFFFFFF" WHITE = "FFFFFFFF"
RED = "FFFF0000" RED = "FFFF0000"
...@@ -382,24 +383,20 @@ class ScoExcelSheet: ...@@ -382,24 +383,20 @@ class ScoExcelSheet:
# recopie des styles # recopie des styles
if style is None: if style is None:
style = self.default_style style = self.default_style
if "font" in style:
cell.font = style["font"]
if "alignment" in style: if "alignment" in style:
cell.alignment = style["alignment"] cell.alignment = style["alignment"]
if "border" in style: if "border" in style:
cell.border = style["border"] cell.border = style["border"]
if "fill" in style: if "fill" in style:
cell.fill = style["fill"] cell.fill = style["fill"]
if "font" in style:
cell.font = style["font"]
if "number_format" in style: if "number_format" in style:
cell.number_format = style["number_format"] cell.number_format = style["number_format"]
if "fill" in style: if comment is not None:
cell.fill = style["fill"]
if "alignment" in style:
cell.alignment = style["alignment"]
if not comment is None:
cell.comment = Comment(comment, "scodoc") cell.comment = Comment(comment, "scodoc")
lines = comment.splitlines() lines = comment.splitlines()
cell.comment.width = 7 * max([len(line) for line in lines]) if lines else 7 cell.comment.width = 7 * max(len(line) for line in lines) if lines else 7
cell.comment.height = 20 * len(lines) if lines else 20 cell.comment.height = 20 * len(lines) if lines else 20
# test datatype to overwrite datetime format # test datatype to overwrite datetime format
...@@ -415,7 +412,7 @@ class ScoExcelSheet: ...@@ -415,7 +412,7 @@ class ScoExcelSheet:
def make_row(self, values: list, style=None, comments=None) -> list: def make_row(self, values: list, style=None, comments=None) -> list:
"build a row" "build a row"
# TODO make possible differents styles in a row # TODO allow differents styles in a row
if comments is None: if comments is None:
comments = [None] * len(values) comments = [None] * len(values)
return [ return [
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment