This section begins the exposition of the actual code, in lightweight literate programming style.
#!/usr/local/bin/python #================================================================ # catweb: Build index to bird photos. For documentation see: # http://www.nmt.edu/~john/scans/slides/catweb/ #----------------------------------------------------------------
Because this application uses generators, the first import must be the one that enables generators
in older versions of Python.
#================================================================ # Imports #---------------------------------------------------------------- from __future__ import generators
The sys module is used for retrieving
command line arguments. We also need the os module for manipulating path names.
import sys, os
The txny module is from A
system for representing bird taxonomy.
import txny as txnyModule
We'll also need the abbr.py
module, which contains the BirdId class.
import abbr as abbrModule
The birdimages module is described
in An XML-based bird cataloging
system. It represents cataloged
images.
import birdimages
The archindex module is described
in archx: A
program to index a photo archive.
from archindex import *
The xml4create module is
documented in Python and the XML Document Object Model
(DOM) with 4Suite.
import xml4create as xc