Fix table formatter with 0.6 version
I didn't see a way to only align header...
This commit is contained in:
parent
5ac2a7cf18
commit
bad531679a
1 changed files with 7 additions and 1 deletions
|
|
@ -69,7 +69,13 @@ class TableFormatter(IFormatter):
|
|||
s += "\n"
|
||||
table = PrettyTable(list(column_headers))
|
||||
for column_header in column_headers:
|
||||
table.set_field_align(column_header, 'l')
|
||||
# API changed in python-prettytable. The try/except is a bad hack to support both versions
|
||||
# Note: two versions are not exactly the same...
|
||||
# (first one: header in center. Second one: left align for header too)
|
||||
try:
|
||||
table.set_field_align(column_header, 'l')
|
||||
except:
|
||||
table.align[column_header] = 'l'
|
||||
for line in queue:
|
||||
table.add_row(line)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue