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

10. Manifest constants

By convention, values constant in this program carry names all in capital letters, with underbar (_) as the word separator.

noteweb
#================================================================
# Manifest constants
#----------------------------------------------------------------

10.1. MONTH_NAME_MAP: Translate month numbers to month names

Internally we carry month numbers such as '03'. This dictionary translates month numbers to month names.

noteweb
MONTH_NAME_MAP  =  {
    '01': 'Jan',  '02': 'Feb',  '03': 'Mar',
    '04': 'Apr',  '05': 'May',  '06': 'Jun',
    '07': 'Jul',  '08': 'Aug',  '09': 'Sep',
    '10': 'Oct',  '11': 'Nov',  '12': 'Dec' }

10.2. MONTH_SEASON_MAP: Define the season for each month

The Audubon Field Notes reporting seasons are tied to months of the year. This dictionary translates month numbers into season names, which in turn connect the rendering of the index table to the seasonal column color codes defined in Section 5.4, “Seasonal column markup rules: th.winter, etc.”.

noteweb
MONTH_SEASON_MAP  =  {
    '01': 'winter',  '02': 'winter',  '03': 'spring',
    '04': 'spring',  '05': 'spring',  '06': 'summer',
    '07': 'summer',  '08': 'fall',    '09': 'fall',
    '10': 'fall',    '11': 'fall',    '12': 'winter' }

10.3. YEAR_PAT: Pattern for year numbers

This pattern matches year numbers in the range 1000-2999. The '$' character is the end-of-line anchor, and matches only at the end of a string.

noteweb
YEAR_PAT  =  re.compile (
    r'[12]'       # First digit must be 1 or 2
    r'\d{3}'      # Followed by three more digits
    r'$' )        # Insure that the entire string was matched

10.4. YYYY_MM_XML_PAT: Month file name pattern

This pattern matches the name of a monthly file such as '2005-09.xml'. Note that it will match invalid month names such as '1999-00.xml' and '2008-19.xml', but that is hardly a world-shattering defect.

noteweb
YYYY_MM_XML_PAT  =  re.compile (
    r'[12]\d{3}'    # Matches 1000-2999
    r'\-'           # Matches '-'
    r'[01]\d'       # Matches 00-19
    r'\.'           # Matches '.'
    r'xml'          # Matches 'xml'
    r'$' )          # End-of line anchor: insure a complete match

10.5. HTML_EXT: File extension for XHTML pages

This string is appended to “yyyy-mm” month names to form the name of each generated monthly report page.

noteweb
HTML_EXT  =  '.html'

10.6. INDEX_PAGE_NAME: Name of the index page

This string, with HTML_EXT appended, is the name of the page to be generated containing the index table.

noteweb
INDEX_PAGE_NAME  =  'field'

10.7. INDEX_PAGE_TITLE

Title of the index page.

noteweb
INDEX_PAGE_TITLE  =  "John W. Shipman's Field Notes"

10.8. HOME_PAGE_URL: Home page URL

noteweb
HOME_PAGE_URL  =  'http://www.nmt.edu/~shipman/'

10.9. CONVENTIONS_URL

This is the URL of the page explaining the conventions used in the field notes display.

noteweb
CONVENTIONS_URL  =  '/~shipman/aba/'

10.10. SEASONS_CLASS: Class attribute for the table of seasons

This class name is used to link the index table to the rule given in Section 5.3, “table.seasons.

noteweb
SEASONS_CLASS  =  'seasons'

10.11. YEAR_GROUP_FREQUENCY

This constant determines how often a year's row in the table has a thicker lower border. For example, if the value is 5, this groups years visually into groups of five, so the reader's eye can more easily track across the row.

noteweb
YEAR_GROUP_FREQUENCY  =  5

10.12. YEAR_GROUP_CLASS: CSS class for years ending a year group

See Section 10.11, “YEAR_GROUP_FREQUENCY for an explanation of year groups. This value is the CSS stylesheet class to be applied to year rows that are a multiple of YEAR_GROUP_FREQUENCY. This class name is tied to the CSS rule in Section 5.5, “CSS rules for rows of the index table”.

noteweb
YEAR_GROUP_CLASS  =  'year-group'

10.13. YEAR_ROW_CLASS

CSS link for rows in the index table for normal years.

noteweb
YEAR_ROW_CLASS  =  'year-row'

10.14. ROW_LABEL_CLASS

This constant defines the CSS class name for the row labels in the index table. See Section 5.5, “CSS rules for rows of the index table”.

noteweb
ROW_LABEL_CLASS  =  'row-label'

10.15. NBSP: Non-breaking space character

The entity   has the Unicode position  .

noteweb
NBSP  =  u'\u00a0'

10.16. PHI: Greek letter ϕ

Greek lowercase phi, used to denote an age class of “female or immature.” Symbolically this entity is “&phiv”.

noteweb
PHI  =  u'\u03d5'

10.17. CSS_URL: Our stylesheet

This is the URL of the stylesheet for the generated pages.

noteweb
CSS_URL  =  'http://www.nmt.edu/~shipman/aba/doc/noteweb/birdnotes.css'

10.18. ZDP_LOGO

 

Escape from the weight of your corporate logo.

 
 --Frank Zappa
noteweb
ZDP_LOGO  =  'http://www.nmt.edu/~shipman/zdplogo.png'

10.19. ZDP_URL

The homepage for navigational links.

noteweb
ZDP_URL  =  'http://www.nmt.edu/~shipman/z'

10.20. LOC_CHILD_CLASS

Used to link to the CSS rule in Section 5.7, “div.loc-child: Indented child block”.

noteweb
LOC_CHILD_CLASS  =  'loc-child'

10.21. NOTABLE_CLASS

Used to link a span element to highlight notable records; see Section 5.2, “Inline markup rules”.

noteweb
NOTABLE_CLASS  =  'notable'

10.22. DAY_SUMMARY_CLASS

CSS class for daily summary blocks; see Section 5.8, “div.day-summary: Daily summary block”.

noteweb
DAY_SUMMARY_CLASS  =  'day-summary'

10.23. LOC_DEF_CLASS

CSS class for locality definitions; see Section 5.9, “div.loc-def: Location definition”.

noteweb
LOC_DEF_CLASS  =  'loc-def'

10.24. LOC_NARRATIVE_CLASS

CSS class for narrative about a locality; see Section 5.10, “div.loc-narrative: Locality narrative”.

noteweb
LOC_NARRATIVE_CLASS  =  'loc-narrative'

10.25. LOC_LABEL_CLASS

CSS class for run-in paragraph labels; see Section 5.2, “Inline markup rules”.

noteweb
LOC_LABEL_CLASS  =  'loc-label'

10.26. PARA_CLASS

CSS class for an ordinary text paragraph; see Section 5.11, “div.para: Ordinary paragraphs”.

noteweb
PARA_CLASS  =  'para'

10.27. FORM_CLASS

CSS class for the div that wraps all data for a single bird form. See Section 5.12, “div.form: General form-related data”.

noteweb
FORM_CLASS  =  'form'

10.28. NOTABLE_FORM_CLASS

A variant for notable records that gives more space.

noteweb
NOTABLE_FORM_CLASS  =  'notable-form'

10.29. BIRD_NAME_CLASS

CSS class for the span that wraps the name of a form of bird.

noteweb
BIRD_NAME_CLASS  =  'bird-name'

10.30. FLOC_CLASS

CSS class for the div element that wraps each sighting in the multi-sighting case.

noteweb
FLOC_CLASS  =  'floc'

10.31. GENUS_CLASS

CSS class for Latin names; see Section 5.2, “Inline markup rules”.

noteweb
GENUS_CLASS  =  'genus'