From 83e810f8b89fde9144c916954a980aa70f3ca89c Mon Sep 17 00:00:00 2001 From: Jesse Cirimelli-Low Date: Wed, 6 Mar 2019 21:12:21 -0800 Subject: [PATCH] added sorting to deliverables output --- compiler/datasheet/datasheet.py | 1 + compiler/datasheet/table_gen.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/compiler/datasheet/datasheet.py b/compiler/datasheet/datasheet.py index a21d3dae..b48d217d 100644 --- a/compiler/datasheet/datasheet.py +++ b/compiler/datasheet/datasheet.py @@ -78,4 +78,5 @@ class datasheet(): self.html += self.corners_table.to_html(comments) # display deliverables table self.html += '

Deliverables

' + self.dlv_table.sort() self.html += self.dlv_table.to_html(comments) diff --git a/compiler/datasheet/table_gen.py b/compiler/datasheet/table_gen.py index a03fea8c..82cb3393 100644 --- a/compiler/datasheet/table_gen.py +++ b/compiler/datasheet/table_gen.py @@ -45,6 +45,8 @@ class table_gen: html += '' html += '' return html + def sort(self): + self.rows[1:] = sorted(self.rows[1:], key=lambda x : x[0]) def to_html(self,comments): """writes table_gen object to inline html"""