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

27. AccessSummary.__isRelevant(): Filter out irrelevant access records

This method examines an access record to see if it passes all the filtering criteria.

webstats.py
# - - -   A c c e s s S u m m a r y . _ _ i s R e l e v a n t

    def __isRelevant ( self, pageGet ):
        '''Filtering for access records.

          [ pageGet is a PageGet instance ->
              if pageGet passes all the filters in
              self.FILTER_FUNCTIONS ->
                  return True
              else -> return False ]
        '''

This method is essentially the composition of a series of smaller filtering functions, each of which applies one test to a PageGet instance and returns True if it is revelant, False if it should be filtered out.

See Section 34, “AccessSummary.FILTER_FUNCTIONS: Collection of filter functions” for the class variable defines the sequence of these filtering functions.

webstats.py
        #-- 1 --
        # [ if any function in self.FILTER_FUNCTIONS,
        #   operating on pageGet, returns False ->
        #     return False
        #   else -> I ]
        for f in self.FILTER_FUNCTIONS:
            if not f(self, pageGet):
                return False

        #-- 2 --
        return True