/[opental]/opental/PlacelessTranslationService/Negotiator.py
ViewVC logotype

Diff of /opental/PlacelessTranslationService/Negotiator.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.10 by lalo, Mon Oct 6 21:58:41 2003 UTC revision 1.11 by gotcha, Thu Nov 13 11:07:38 2003 UTC
# Line 29  except NameError: Line 29  except NameError:
29  def lang_normalize(lang):  def lang_normalize(lang):
30      return lang.replace('_', '-')      return lang.replace('_', '-')
31    
32    
33    def str_lower(aString):
34        return aString.lower()
35    
36  def type_accepted(available, preferred):  def type_accepted(available, preferred):
37      # ex: preferred is text/* and available is text/html      # ex: preferred is text/* and available is text/html
38      av = available.split('/')      av = available.split('/')
# Line 46  def _false(*a, **kw): Line 50  def _false(*a, **kw):
50    
51  class Negotiator:  class Negotiator:
52      filters = {      filters = {
53          'content-type': (str.lower,),          'content-type': (str_lower,),
54          'language': (str.lower, lang_normalize),          'language': (str_lower, lang_normalize),
55      }      }
56    
57      tests = {      tests = {

Legend:
Removed from v.1.10  
changed lines
  Added in v.1.11

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26