Next / Previous / Contents / TCC Help System / NM Tech homepage

36.2. CensusRowLabel.html()

The generated th element is connected with the stylesheet using the class defined in Section 13.4.11, “CLASS_CENSUS_ROW_LABEL. There are two cases:

cbchistlib.py
# - - -   C e n s u s R o w L a b e l . h t m l

    def html(self, sox, **kw):
        '''Render self as XHTML.
        '''
        #-- 1
        # [ sox  +:=  a td et.Element with CLASS_CENSUS_ROW_LABEL
        #   td  :=  the sox.Elt for that element ]
        td = sox.start("td", CLASS_CENSUS_ROW_LABEL, kw, valign='top')

        #-- 2
        # [ if birdId.rel == abbrMod.REL_SIMPLE ->
        #     if birdId.abbr is defined in self.birdId.txny ->
        #       sox  +:=  the Taxon for birdId.abbr, formatted as XHTML
        #                 in inverted order
        #     else -> raise ScriptError
        #   else if birdId.abbr and birdId.abbr2 are both defined in
        #   birdId.txny ->
        #     sox +:=  (a div containing the Taxon for birdId.abbr,
        #         formatted as XHTML in inverted order) + (a div
        #         containing birdId.rel + (' ') + the Taxon for
        #         birdId.abbr2, formatted as XHTML)
        #   else -> raise ScriptError ]
        if self.birdId.rel.strip() == '':
            self._htmlSimple(sox)
        else:
            self._htmlCompound(sox)

        #-- 3
        td.end()