/usr/share/pyshared/zope/ucol/localeadapter.py is in python-zope.ucol 1.0.2-2ubuntu6.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | ##############################################################################
#
# Copyright (c) 2004 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
"""Trivial adapter that adapts a zope.i18n locale to a collator
This adapter takes an object that has a getLocaleID method that
returns a locale string. It returns a Collator for the given locale:
>>> class Locale:
... def __init__(self, id):
... self.id = id
... def getLocaleID(self):
... return self.id
>>> collator = LocaleCollator(Locale('da_DK'))
>>> collator.__class__.__name__
'Collator'
>>> collator.locale
'da_DK'
Note that we're not declaring any interfaces so as to avoid creating
a dependency on zope.i18n.locales.
$Id: localeadapter.py 67613 2006-04-26 08:21:40Z dobe $
"""
from zope.ucol import Collator
def LocaleCollator(locale):
return Collator(str(locale.getLocaleID()))
|