jp (common): fixed empty table display when headers are specified

This commit is contained in:
Goffi 2017-08-23 00:08:30 +02:00
commit 40fa0ed846

View file

@ -555,6 +555,10 @@ class Table(object):
raise exceptions.DataError(u'rows size is not coherent')
self.rows.append(new_row)
if not data and headers is not None:
# the table is empty, we print headers at their lenght
self.sizes = [len(h) for h in headers]
@staticmethod
def readDictValues(data, keys, defaults=None):
if defaults is None: