mirror of
				https://github.com/ARM-software/workload-automation.git
				synced 2025-11-04 00:52:08 +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:
		@@ -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
 | 
			
		||||
of the prifix to the corresponding priority:
 | 
			
		||||
 | 
			
		||||
=========== ===
 | 
			
		||||
=========== ========
 | 
			
		||||
prefix      priority
 | 
			
		||||
=========== ===
 | 
			
		||||
very_fast\_  20
 | 
			
		||||
fast\_       10
 | 
			
		||||
normal\_      0
 | 
			
		||||
slow\_      -10
 | 
			
		||||
very_slow\_ -20
 | 
			
		||||
=========== ===
 | 
			
		||||
=========== ========
 | 
			
		||||
very_fast\_       20
 | 
			
		||||
fast\_            10
 | 
			
		||||
normal\_           0
 | 
			
		||||
slow\_           -10
 | 
			
		||||
very_slow\_      -20
 | 
			
		||||
=========== ========
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -174,6 +174,8 @@ def format_simple_table(rows, headers=None, align='>', show_borders=True, border
 | 
			
		||||
 | 
			
		||||
    cols = zip(*rows)
 | 
			
		||||
    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 += '\n'
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user