The base classes, along with some utility functions, live
in file baseclasses.py. We start
our literate exposition of the code with these lines that
form a Python module documentation string at the beginning
of the file.
'''baseclasses.py: Base classes for IBP banding data entry system.
Do not edit this file directly. It is extracted mechanically
from the specification:
http://www.nmt.edu/~shipman/z/ibp/doc/iband7/ims/
'''
This module uses two of the author's standard library modules:
log.py handles the logging of errors
to the standard error stream, and optionally to one
or more log files.
scan.py manages the progression of a
program through an input file, and simplifies the
generation of error messages that show the user the
offending line and the current position within that
line.
Sources and documentation for these modules are available
at Logging, scanning, and singleton objects for Python:
logscan.py and
singleton.py.
Here are the imports for the baseclasses.py file. Because we use Python
generators, the first import is necessary to enable
generators.
#================================================================ # Imports #---------------------------------------------------------------- from __future__ import generators
We'll also need some standard modules: the Python
string and regular expression matching
modules.
import string import re
Next, import everything from log.py and scan.py library routines.
from log import * from scan import *