X-Git-Url: http://git.inspyration.org/?a=blobdiff_plain;f=ods.py;h=ff6f0b897213ddb0022b5cbebab2d50ee4d13246;hb=HEAD;hp=196b9b5eba263f87f0997ad3b72d0f81e30b3559;hpb=31178f75688004c9d66bb59f69801968c7fb423c;p=oeodf%2Ftodolist_ods_builder.git diff --git a/ods.py b/ods.py index 196b9b5..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']] @@ -78,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: