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

51.16. class PageGet: Describes one page access

The PageGet object is an abstract data type containing the relevant information from the access log about one page access attempt.

Note that one access log line may be translated into zero, one, or several PageGet objects.

Here is the exported interface for this class:

pageget.py
# - - - - -   c l a s s   P a g e G e t   - - - - -

class PageGet:
    """Class to represent one line from the Apache access_log

      Exports:
        PageGet ( accessor, username, when, command, url, status ):
          [ if (accessor is the remote site's IP address as a string)
            and (username is the username if the page is under
            password protection, "-" otherwise)
            and (when is the time of the access as a datetime.datetime)
            and (command is the command, e.g., "GET" or "POST")
            and (url is the URL the accessor wants to load)
            and (status is the usual HTTP return status as an integer) ->
              return a new PageGet object representing that access ]
        .accessor:      [ as passed to constructor ]
        .username:      [ as passed to constructor ]
        .when:          [ as passed to constructor ]
        .command:       [ as passed to constructor ]
        .url:           [ as passed to constructor ]
        .status:        [ as passed to constructor ]
        .isFar ( symDomain, ipDomain ):
            [ if (symDomain is a list of strings representing the
              symbolic form of the local domain such as ["nmt","edu"])
              and (ipDomain is a list of strings representing the
              numeric form of the local domain such as ["129","138"]) ->
                if (self.accessor is a single name)
                or (its last parts match symDomain)
                or (its first parts match ipDomain) ->
                  return False
                else -> return True ]
        str(self):
          [ return a string representing self for debug use ]
    """