Revision: 40b54256680e
Author:   Mikko Korpela <[email protected]>
Date:     Tue Jan 10 05:00:23 2012
Log: formatters: do not try to align var and setting tables in html format
http://code.google.com/p/robotframework/source/detail?r=40b54256680e

Modified:
 /src/robot/writer/formatters.py

=======================================
--- /src/robot/writer/formatters.py     Mon Jan  9 00:30:06 2012
+++ /src/robot/writer/formatters.py     Tue Jan 10 05:00:23 2012
@@ -43,6 +43,9 @@
     def _format_row(self, row):
         return row

+    def _should_align_columns(self, table):
+ return table.type in ['test case', 'keyword'] and bool(table.header[1:])
+

 class TsvFormatter(_TestDataFileFormatter):

@@ -106,9 +109,6 @@
                                  self._align_last_column)
         return RowSplittingFormatter(self._cols)

-    def _should_align_columns(self, table):
- return table.type in ['test case', 'keyword'] and bool(table.header[1:])
-
     def _format_row(self, row):
         return self._escape(row)

@@ -180,7 +180,7 @@
         return SingleLineHtmlFormatter(self._cols)

     def header_row(self, table):
-        if len(table.header) == 1:
+        if not self._should_align_columns(table) or len(table.header) == 1:
             return [HeaderCell(table.header[0], self._default_cols)]
         headers = self._pad_header(table)
         return [HeaderCell(hdr) for hdr in headers]

Reply via email to