Back to index

plone3  3.1.7
Public Member Functions | Public Attributes
plone.i18n.normalizer.adapters.UserPreferredFileNameNormalizer Class Reference

List of all members.

Public Member Functions

def __init__
def normalize

Public Attributes


Detailed Description

An adapter for the HTTPRequest to provide user preferred language
dependent normalization.

Let's make sure that this implementation actually fulfills the API.

  >>> from zope.interface.verify import verifyClass
  >>> verifyClass(IUserPreferredFileNameNormalizer, UserPreferredFileNameNormalizer)

Definition at line 11 of file

Constructor & Destructor Documentation

Definition at line 24 of file

00025     def __init__(self, context):
00026         self.context = context # the context must be the request

Here is the caller graph for this function:

Member Function Documentation

Returns a normalized Unicode string.

Definition at line 27 of file

00028     def normalize(self, text):
00029         """Returns a normalized Unicode string."""
00030         locale = None
00031         langs = IUserPreferredLanguages(self.context).getPreferredLanguages()
00032         if langs:
00033             locale = langs[0]
00035         util = queryUtility(IFileNameNormalizer)
00036         return util.normalize(text, locale=locale)

Here is the caller graph for this function:

Member Data Documentation

Definition at line 25 of file

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