Package aquarium :: Package parse :: Module AcceptLanguage
[show private | hide private]
[frames | no frames]

Module aquarium.parse.AcceptLanguage

Parse the Accept-Language header.


Function Summary
  parseAcceptLanguage(header)
Parse the Accept-Language header.

Variable Summary
SRE_Pattern languageRegEx = ^[a-z]{2}(-[a-z]{2})?$

Function Details

parseAcceptLanguage(header=None)

Parse the Accept-Language header.

Return a list of language tags sorted by their "q" values. For example, "en-us,en;q=0.5" should return ["en-us", "en"]. If there is no Accept-Language header present, default to [].


Variable Details

languageRegEx

Type:
SRE_Pattern
Value:
^[a-z]{2}(-[a-z]{2})?$                                                 

Generated by Epydoc 2.1 on Mon Jan 1 16:34:19 2007 http://epydoc.sf.net