Package yadis :: Module filters :: Class TransformFilterMaker
[hide private]
[frames] | no frames]

Class TransformFilterMaker

source code

object --+
         |
        TransformFilterMaker

Take a list of basic filters and makes a filter that transforms the basic filter into a top-level filter. This is mostly useful for the implementation of mkFilter, which should only be needed for special cases or internal use by this library.

This object is useful for creating simple filters for services that use one URI and are specified by one Type (we expect most Types will fit this paradigm).

Creates a BasicServiceEndpoint object and apply the filter functions to it until one of them returns a value.

Instance Methods [hide private]
  __init__(self, filter_functions)
Initialize the filter maker's state
  getServiceEndpoints(self, yadis_url, service_element)
Returns an iterator of endpoint objects produced by the filter functions.
  applyFilters(self, endpoint)
Apply filter functions to an endpoint until one of them returns non-None.

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__


Properties [hide private]

Inherited from object: __class__


Method Details [hide private]

__init__(self, filter_functions)
(Constructor)

source code 

Initialize the filter maker's state
Parameters:
  • filter_functions - The endpoint transformer functions to apply to the basic endpoint. These are called in turn until one of them does not return None, and the result of that transformer is returned.
Overrides: object.__init__

getServiceEndpoints(self, yadis_url, service_element)

source code 

Returns an iterator of endpoint objects produced by the filter functions.

applyFilters(self, endpoint)

source code 

Apply filter functions to an endpoint until one of them returns non-None.