X-Git-Url: http://git.inspyration.org/?a=blobdiff_plain;f=ods.py;h=ff6f0b897213ddb0022b5cbebab2d50ee4d13246;hb=HEAD;hp=9a3161ed297da690869232681c3787cf43aa5ca8;hpb=3993ead7f8b722f80009a4ee9b42ef7e302b6127;p=oeodf%2Ftodolist_ods_builder.git diff --git a/ods.py b/ods.py index 9a3161e..ff6f0b8 100644 --- a/ods.py +++ b/ods.py @@ -42,6 +42,21 @@ def create_doc(containers, container_tasks): linenumber="0")) document.styles.addElement(tablecontents) + + # Création des styles de colonnes + width25 = Style(name="Wshort", family="table-column") + width25.addElement(TableColumnProperties(columnwidth="2.5cm")) + document.automaticstyles.addElement(width25) + + width3 = Style(name="Wwide", family="table-column") + width3.addElement(TableColumnProperties(columnwidth="3cm")) + document.automaticstyles.addElement(width3) + + width9 = Style(name="Wwide", family="table-column") + width9.addElement(TableColumnProperties(columnwidth="9cm")) + document.automaticstyles.addElement(width9) + + #Création des styles de titres titre1= Style(name="titre1", family="table-cell") titre1.addElement(TextProperties(fontweight="bold", fontsize="11", color="#1FA055")) document.automaticstyles.addElement(titre1) @@ -56,6 +71,10 @@ def create_doc(containers, container_tasks): for c in containers: table = Table(name=c['name']) + + table.addElement(TableColumn(numbercolumnsrepeated=1,stylename=width3)) + table.addElement(TableColumn(numbercolumnsrepeated=1,stylename=width9)) + table.addElement(TableColumn(numbercolumnsrepeated=5,stylename=width25)) document.spreadsheet.addElement(table) tasks = container_tasks[c['id']] @@ -67,7 +86,6 @@ def create_doc(containers, container_tasks): tr.addElement(create_cell("")) tr.addElement(create_cell("Target :", "titre1")) tr.addElement(create_cell(c["target"])) - tr.addElement(create_cell("")) tr.addElement(create_cell("Milestone :", "titre1")) tr.addElement(create_cell(c["milestone"])) @@ -79,13 +97,13 @@ def create_doc(containers, container_tasks): if not tasks: continue + #New line table.addElement(TableRow()) tr = TableRow() table.addElement(tr) tr.addElement(create_cell("Tasks :", "titre1")) - tr = TableRow() table.addElement(tr) for k in task_keys: