Next / Previous / Contents / Shipman's homepage

21. class BirdNoteTree: A complete set of notes

If the notes are stored in a directory tree, divided into yearly subdirectories with monthly files as described in Section 6, “Directory structure for data files”, you can use a single object to manage a complete set of notes files.

The intent of the BirdNoteTree class is to extract records from such a directory tree. In particular, it is intended for a Web-based query interface, where the user may be interested only in records from specific regions or periods.

To save time and computer memory, this class does not immediately read every notes file in the tree. Once you have instantiated the class, you will use its .genMonths() method to generate a sequence of BirdNoteSet instances, one per month.

The .genMonths() method includes options for selecting records by date and by season. For example, if the user is interested only in summer records from a specific decade, the program reads only those monthly files that are from summer months in those years.

21.1. BirdNoteTree(): Constructor

To open a directory tree, use this calling sequence:

BirdNoteTree ( T, rootDir="." )

The T argument is an instance of class Txny (as used in Section 8.1, “BirdNoteSet(): Constructor”).

The optional rootDir argument is the path name of the root directory. The default is “.”, the current working directory.

Attributes of the instance include:


As passed to the constructor.


As passed to the constructor.