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

10.37. class HistArgs(): CGI argument processing

This class processes the arguments coming from the form submission via the CGI interface. We use the Singleton design pattern with this class, as discussed in the similar class defined in Section 10.37, “class HistArgs(): CGI argument processing”.

hist.cgi
# - - - - -   c l a s s   H i s t A r g s

class HistArgs(singleton.Singleton):
    '''Represents the incoming values from the regional index form.

      Exports:
        HistArgs():
          [ if the CGI arguments are valid for this script ->
              return the singleton HistArgs instance representing those
              values
            else -> raise ScriptError ]
        .firstYear:
          [ if the form had a valid FIRST_YEAR_ENTRY value ->
              that value in year-number format
            else -> lib.MIN_YEAR ]
        .lastYear:
          [ if the form had a valid LAST_YEAR_ENTRY value ->
              that value in year-number format
            else -> lib.MAX_YEAR ]
        .lumpSubsp:
          [ if the form requested that subspecies be lumped -> True
            else -> False ]
        .nmAlias:
          [ if the form requested the New Mexico species alias set ->
              True
            else -> False ]
        .yearLumping:
          [ if the form requested year column lumping -> True
            else -> False ]
        .latLonList:
          [ if (the form had at least one LAT_LON value) and
            (all values were valid lat-lons in "ddmm-DDDMM" format) ->
              those values as a list of ("ddmm", "DDDMM") tuples ]
          NB: These tuples are set up so you can retrieve the
          corresponding Circle from the database using:
            db.getCircle(*t)
        .pdf:
          [ if the form requested PDF output -> True
            else -> False ]
    '''
    initialized = False

For the definition of year-number format, see Section 14.4, “year-number.