Next / Previous / Contents / Shipman's homepage

23.21. MonthCell.__multiSighting(): Multiple-sighting case

See the general remarks in Section 23.19, “MonthCell.__birdForm(): Render one BirdForm.

noteweb
# - - -   M o n t h C e l l . _ _ m u l t i S i g h t i n g

    def __multiSighting ( self, div, birdForm ):
        '''Render the multi-sighting case of a bird form.

          [ (div is an et.Element) and
            (birdForm is a birdnotes.birdForm instance) ->
              div  +:=  (birdForm's loc-group content, if any) +
                  (birdForm's sighting-notes, if any) +
                  (birdForm's sightings packaged in separate divs) ]
        '''

See Section 23.22, “MonthCell.__locGroup(): Render a locality group”. We want to display this only if there is locality data explicitly attached at this level; if the locality is all inherited, the children will take care of displaying their localities.

noteweb
        #-- 1 --
        # [ if birdForm.locGroup is not None ->
        #     div  +:=  XHTML rendering of birdForm.locGroup
        #   else -> I ]
        if birdForm.locGroup is not None:
            self.__locGroup ( div, birdForm.locGroup )         

See Section 23.23, “MonthCell.__sightNotes(): Render a sighting notes group”.

noteweb
        #-- 2 --
        # [ if birdForm.sightNotes is not None ->
        #     div  +:=  XHTML rendering of birdForm.sightNotes ]
        if birdForm.sightNotes:
            self.__sightNotes ( div, birdForm.sightNotes )

Everything else we need to generate comes from child sightings of birdForm. See Section 23.25, “MonthCell.__floc(): Generate one of multiple sightings”.

noteweb
        #-- 3 --
        # [ div  +:=  birdForm's sightings packaged in separate
        #             divs ]
        for sight in birdForm.genSightings():
            #-- 3 body --
            # [ div  +:=  sight packaged in a separate div ]
            self.__floc ( div, sight )