Back to index

plone3  3.1.7
Public Member Functions | Static Public Attributes | Private Member Functions
PlacelessTranslationService.Negotiator.Negotiator Class Reference

List of all members.

Public Member Functions

def negotiate
def getLanguage
def getLanguages

Static Public Attributes

dictionary tests

Private Member Functions

def _negotiate

Detailed Description

Definition at line 216 of file

Member Function Documentation

def PlacelessTranslationService.Negotiator.Negotiator._negotiate (   self,
) [private]

Definition at line 227 of file

00228     def _negotiate(self, choices, request, kind):
00229         userchoices = getLangPrefs(request, kind)
00230         # Prioritize on the user preferred choices. Return the first user
00231         # preferred choice that the object has available.
00232         test = self.tests.get(kind, _false)
00233         for choice in userchoices:
00234             if choice in choices:
00235                 return choice
00236             for l_avail in choices:
00237                 if test(l_avail, choice):
00238                     return l_avail
00239         return None

Here is the call graph for this function:

Here is the caller graph for this function:

def PlacelessTranslationService.Negotiator.Negotiator.getLanguage (   self,

Definition at line 241 of file

00242     def getLanguage(self, langs, request):
00243         return self.negotiate(langs, request, 'language')

Here is the call graph for this function:

Definition at line 244 of file

00245     def getLanguages(self, request):
00246         return getLangPrefs(request, 'language')

Here is the call graph for this function:

def PlacelessTranslationService.Negotiator.Negotiator.negotiate (   self,
  kind = 'content-type' 

Definition at line 223 of file

00224     def negotiate(self, choices, request, kind='content-type'):
00225         choices = tuple(choices)
00226         return self._negotiate(choices, request, kind)

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

Initial value:
        'content-type': type_accepted,
        'language': lang_accepted,

Definition at line 218 of file

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