Logo Search packages:      
Sourcecode: viewvc version File versions  Download package

accept::_LanguageSelector Class Reference

List of all members.

Detailed Description

Instances select an available language based on the user's request.

Languages found in the user's request are added to this object with the
append() method (they should be instances of _LanguageRange). After the
languages have been added, then the caller can use select_from() to
determine which user-request language(s) best matches the set of
available languages.

Strictly speaking, this class is pretty close for more than just
language matching. It has been implemented to enable q-value based
matching between requests and availability. Some minor tweaks may be
necessary, but simply using a new 'item_class' should be sufficient
to allow the _parse() function to construct a selector which holds
the appropriate item implementations (e.g. _LanguageRange is the
concrete _AcceptItem class that handles matching of language tags).

Definition at line 110 of file accept.py.

Public Member Functions

def __init__
def append
def select_from

Public Attributes


Static Public Attributes

 item_class = _LanguageRange

The documentation for this class was generated from the following file:

Generated by  Doxygen 1.6.0   Back to index