From: Alicia FLOREZ Date: Thu, 28 Mar 2013 16:45:41 +0000 (+0100) Subject: Ajout taille colonnes X-Git-Url: http://git.inspyration.org/?p=oeodf%2Ftodolist_ods_builder.git;a=commitdiff_plain;h=22cde3af1a8f170a9976c8352c7c809cf450095c Ajout taille colonnes --- diff --git a/ods.py b/ods.py index 196b9b5..936aec0 100644 --- a/ods.py +++ b/ods.py @@ -42,6 +42,18 @@ def create_doc(containers, container_tasks): linenumber="0")) document.styles.addElement(tablecontents) + 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) + titre1= Style(name="titre1", family="table-cell") titre1.addElement(TextProperties(fontweight="bold", fontsize="11", color="#1FA055")) document.automaticstyles.addElement(titre1) @@ -56,6 +68,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 +94,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: diff --git a/odsgen b/odsgen index dc88f19..8b5c8e4 100644 --- a/odsgen +++ b/odsgen @@ -29,8 +29,8 @@ if __name__ == '__main__': except: print('Serveur éteint ou Identifiants incorrects') else: - print('Test sur res.user : %s' % - (get_user_name(connection, 'admin') == 'Administrator')) + #print('Test sur res.user : %s' % + # (get_user_name(connection, 'admin') == 'Administrator')) containers = get_containers(connection) tasks = {c["id"]: get_tasks(connection, c["tasks"]) for c in containers}