gavo.web.htmltable module

A renderer for Data to HTML/stan

class gavo.web.htmltable.HTMLDataRenderer(table, queryMeta)[source]

Bases: NevowcElement

A base class for rendering tables and table lines.

Both HTMLTableFragment (for complete tables) and HTMLKeyValueFragment (for single rows) inherit from this.

data_fielddefs(request, tag)[source]
footnotes(request, tag)[source]

renders the footnotes as a definition list.

meta(request, tag)[source]
class gavo.web.htmltable.HTMLKeyValueFragment(table, queryMeta)[source]

Bases: HTMLDataRenderer, HeadCellsMixin

A nevow renderer for single-row result tables.

coldefdesc(request, tag)[source]

returns the description of a colDev in a firstrow sequence.

data_firstrow(request, tag)[source]

returns a sequence for (colDef, serialised value) for the first row of the result table.

property loader
makeLoader()[source]
class gavo.web.htmltable.HTMLTableFragment(table, queryMeta)[source]

Bases: HTMLDataRenderer

A nevow renderer for result tables.

headCells(request, tag)[source]

returns the header line for this table as an XML string.

loader: Optional[ITemplateLoader] = <twisted.web._template_util.TagLoader object>
rowSet(request, tag)[source]
rowsPerDivision = 25
tableBody(request, tag)[source]

returns HTML-rendered table rows in chunks of rowsPerDivision.

We don’t use stan here since we can concat all those tr/td much faster ourselves.

class gavo.web.htmltable.HeadCells(serManager)[source]

Bases: Element, HeadCellsMixin

loader: Optional[ITemplateLoader] = <gavo.formal.nevowc.XMLString object>
class gavo.web.htmltable.HeadCellsMixin[source]

Bases: CommonRenderers

A mixin providing renders for table headings.

The class mixing in must give the SerManager used in a serManager attribute.

data_fielddefs(request, tag)[source]
headCell(request, tag)[source]
gavo.web.htmltable.writeDataAsHTML(data, outputFile, acquireSamples=False)[source]

writes data’s primary table to outputFile.

(acquireSamples is actually ignored; it is just present for compatibility with the other writers until I rip out the samples stuff altogether).