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.
To open a directory tree, use this calling sequence:
BirdNoteTree ( T, rootDir="." )
The
argument is an instance of class TTxny (as
used in Section 8.1, “BirdNoteSet(): Constructor”).
The optional argument is the path name of the root
directory. The default is “rootDir.”, the current working directory.
Attributes of the instance include:
.txny
As passed to the constructor.
.rootDir
As passed to the constructor.