[meta-freescale] [Documentation][PATCH 3/4] tabularize: fix column sizing if there is only one column
Lucas Dutra Nunes
ldnunes at ossystems.com.br
Sat Feb 27 06:40:22 PST 2016
The column sizing method can fail if there is only one column size to
measure. By adding a zero sized column to the sizing lambda the problem
is solved.
Signed-off-by: Lucas Dutra Nunes <ldnunes at ossystems.com.br>
---
scripts/doc_utils.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/doc_utils.py b/scripts/doc_utils.py
index 8344eaf..9d11bd8 100644
--- a/scripts/doc_utils.py
+++ b/scripts/doc_utils.py
@@ -19,7 +19,7 @@ def tabularize(lines, spacing=2):
spc = ' ' * spacing
if lines:
- col_widths = map(lambda col: apply(max, map(len, col)),
+ col_widths = map(lambda col: apply(max, map(len, col) + [0]),
apply(zip, lines))
return '\n'.join([format_header(lines[0], col_widths, spc),
format_body(lines[1:], col_widths, spc),
--
2.1.4
More information about the meta-freescale
mailing list