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

14.3. Logic errors

Ordinary logic errors.

  1. Neglected to include the “pound-bang line” at the beginning, not to mention the comment pointing at this documentation.

  2. The handling of questionable identifications, such as ab6='hamfly?' for possible Hammond's Flycatcher, was completely dropped in design. I thought I had modified the BirdId class in the module to handle this, but that modification never went in.

  3. In TaxonPhotoSet.buildPage(), neglected to implement the logic for the case where no forms refer to that taxon. The cases of one form and multiple forms were fine. If there is no form, then the taxon's name appears without being a link to anything.

  4. In FormPhotoSet.buildPage(), I wrote the line to create the new file when I was tired, and forgot basic Python:

            pageFile = open(pagePath, "new")

    It should be:

            pageFile = open(pagePath, "w")

  5. Neglected actually to write out the index page when it is finished. Added logic:

        #-- 3
        # [ if  index page can be created anew ->
        #     index page  :=  indexPage, serialized ]
        indexFile = open(INDEX_PAGE, "w")

  6. Got the URL of the stylesheet wrong:


    It should be:


  7. In TaxonPhotoSet.buildPage, the class of the div elements for higher taxa was build with the wrong separator:

            div["class"] = "head_%s" % self.taxon.rank.code

    It should be:

            div["class"] = "head-%s" % self.taxon.rank.code

  8. In FormPhotoSet._addThumbnail(), the logic that sets up the image link is brain-dead:

            href = "thumb/%s.jpg" % archImage.original.catNo
            xc.Element(td, "img", src="href", alt="thumbnail")

    The second line should be:

            xc.Element(td, "img", src=href, alt="thumbnail")

  9. In FormPhotoSet._addThumbnail(), the path to the thumbnail has to go up one level before it goes back down to the thumbnail directory:

            href = "thumb/%s.jpg" % archImage.original.catNo

    It should be:

            href = "../thumb/%s.jpg" % archImage.original.catNo

  10. In TaxonPhotoSet._buildMultiForms(), neglected to place the taxon's name in the higher-taxon div. New first prime:

            #-- 1
            # [ parent  :=  parent with self's name added as text ]

  11. In FormPhotoSet.pathName(), forgot that bird codes can be right-blank padded. The cure is to call .rstrip() on all bird codes before forming them into pathnames.

  12. Neglected to implement the design goal of suppressing a genus name headings if no form is referred to it. Rewrote TaxonPhotoSet.buildPage(): don't allocate a div until we have eliminated this case.

  13. FormPhotoSet.pathName() generated the same path name for questionable forms as for regular ones. The fix is to append "-q" for questionable forms.