1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-01-18 20:11:20 +00:00

Minor fix to rst table generation.

Updated format_simple_table to take headers into account when
calculating column widths. Also updated docs where it currently used.
This commit is contained in:
Sergei Trofimov 2015-03-18 10:47:07 +00:00
parent 3e0c8aa83b
commit aa74e1e8f5
2 changed files with 10 additions and 8 deletions

View File

@ -61,13 +61,13 @@ Instrument method realive to other callbacks registered for the signal (within t
level, callbacks are invoked in the order they were registered). The table below shows the mapping level, callbacks are invoked in the order they were registered). The table below shows the mapping
of the prifix to the corresponding priority: of the prifix to the corresponding priority:
=========== === =========== ========
prefix priority prefix priority
=========== === =========== ========
very_fast\_ 20 very_fast\_ 20
fast\_ 10 fast\_ 10
normal\_ 0 normal\_ 0
slow\_ -10 slow\_ -10
very_slow\_ -20 very_slow\_ -20
=========== === =========== ========

View File

@ -174,6 +174,8 @@ def format_simple_table(rows, headers=None, align='>', show_borders=True, border
cols = zip(*rows) cols = zip(*rows)
col_widths = [max(map(len, c)) for c in cols] col_widths = [max(map(len, c)) for c in cols]
if headers:
col_widths = [max(len(h), cw) for h, cw in zip(headers, col_widths)]
row_format = ' '.join(['{:%s%s}' % (align[i], w) for i, w in enumerate(col_widths)]) row_format = ' '.join(['{:%s%s}' % (align[i], w) for i, w in enumerate(col_widths)])
row_format += '\n' row_format += '\n'