Package CHEM :: Package Common :: Module ResultsFormatter :: Class HtmlResultsFormatter
[hide private]
[frames] | no frames]

Class HtmlResultsFormatter



ResultsFormatter --+
                   |
                  HtmlResultsFormatter

Formatter for displaying database output in a web table.

Instance Methods [hide private]
 
__init__(self, outFile, headerRowFormat=None, headerColFormat="td", align="left", valign="top", printNone=True, lineSeparators=False)
Initialization constructor.
 
formatTuple(self, tuple, lastTuple=None)
Given a result set tuple, as in from DBUtil.execute, write out a representation suitable for html output with one <tr>...</tr> block per row, with each column delimited by <td>...</td> blocks.

Inherited from ResultsFormatter: formatResultDicts, formatResultSet, getGroupColumns, getHeaderRow, getOutFile, setGroupColumns, setHeaderRow, setOutFile

Class Variables [hide private]

Inherited from ResultsFormatter: outFile

Method Details [hide private]

__init__(self, outFile, headerRowFormat=None, headerColFormat="td", align="left", valign="top", printNone=True, lineSeparators=False)
(Constructor)

 
Initialization constructor. outFile: File to write formatted output to. headerRowFormat: If non-None, will format the first row differently from the rest, using the format tag specified headerColFormat: The first column of each row will be formatted using this tag align: All columns will be horizontally aligned according to this parameter.
Overrides: ResultsFormatter.__init__

formatTuple(self, tuple, lastTuple=None)

 

Given a result set tuple, as in from DBUtil.execute, write out a representation suitable for html output with one <tr>...</tr> block per row, with each column delimited by <td>...</td> blocks.

If headerRow was set on instantiation, the first time this method is called, the row output will formatter based on the specified headerRowFormat.

This does NOT output the <table> and </table> tags, which the caller should manage instead. This allows the caller to set table properties as desired.
Overrides: ResultsFormatter.formatTuple