summaryrefslogtreecommitdiff
path: root/src/zope/i18n/locales
diff options
context:
space:
mode:
Diffstat (limited to 'src/zope/i18n/locales')
-rw-r--r--src/zope/i18n/locales/__init__.py4
-rw-r--r--src/zope/i18n/locales/tests/test_xmlfactory.py29
-rw-r--r--src/zope/i18n/locales/xmlfactory.py6
3 files changed, 25 insertions, 14 deletions
diff --git a/src/zope/i18n/locales/__init__.py b/src/zope/i18n/locales/__init__.py
index 27de94c..989fdff 100644
--- a/src/zope/i18n/locales/__init__.py
+++ b/src/zope/i18n/locales/__init__.py
@@ -33,7 +33,9 @@ from zope.i18n.locales.inheritance import (
InheritingDictionary,
NoParentException,
)
-from zope.i18n.locales.provider import LocaleProvider, LoadLocaleError
+# LoadLocaleError is not used, but might be imported from here by others.
+from zope.i18n.locales.provider import LoadLocaleError # noqa
+from zope.i18n.locales.provider import LocaleProvider
# Setup the locale directory
diff --git a/src/zope/i18n/locales/tests/test_xmlfactory.py b/src/zope/i18n/locales/tests/test_xmlfactory.py
index b1c09bd..2ed49eb 100644
--- a/src/zope/i18n/locales/tests/test_xmlfactory.py
+++ b/src/zope/i18n/locales/tests/test_xmlfactory.py
@@ -34,19 +34,26 @@ class LocaleXMLFileTestCase(TestCase):
# XXX: The tests below are commented out because it's not
# necessary for the xml files to have all format definitions.
- ## Making sure all number format patterns parse
- # for category in (u'decimal', u'scientific', u'percent', u'currency'):
- # for length in getattr(locale.numbers, category+'Formats').values():
- # for format in length.formats.values():
- # self.assert_(parseNumberPattern(format.pattern) is not None)
+ # # Making sure all number format patterns parse
+ # for category in (u"decimal", u"scientific", u"percent", u"currency"):
+ # for length in getattr(
+ # locale.numbers, category + "Formats"
+ # ).values():
+ # for format in length.formats.values():
+ # self.assert_(
+ # parseNumberPattern(format.pattern) is not None
+ # )
- ## Making sure all datetime patterns parse
+ # # Making sure all datetime patterns parse
# for calendar in locale.dates.calendars.values():
- # for category in ('date', 'time', 'dateTime'):
- # for length in getattr(calendar, category+'Formats').values():
- # for format in length.formats.values():
- # self.assert_(
- # parseDateTimePattern(format.pattern) is not None)
+ # for category in ("date", "time", "dateTime"):
+ # for length in getattr(
+ # calendar, category + "Formats"
+ # ).values():
+ # for format in length.formats.values():
+ # self.assert_(
+ # parseDateTimePattern(format.pattern) is not None
+ # )
def test_suite():
diff --git a/src/zope/i18n/locales/xmlfactory.py b/src/zope/i18n/locales/xmlfactory.py
index 244d17e..bfbd593 100644
--- a/src/zope/i18n/locales/xmlfactory.py
+++ b/src/zope/i18n/locales/xmlfactory.py
@@ -347,7 +347,8 @@ class LocaleFactory(object):
>>> names[7:]
[u'August', u'September', u'Oktober', u'November', u'Dezember']
- >>> abbrs = [ctx.months[u"abbreviated"][type] for type in range(1,13)]
+ >>> abbrs = [ctx.months[u"abbreviated"][type]
+ ... for type in range(1,13)]
>>> abbrs[:6]
[u'Jan', u'Feb', u'Mrz', u'Apr', u'Mai', u'Jun']
>>> abbrs[6:]
@@ -1344,7 +1345,8 @@ class LocaleFactory(object):
>>> xml = u'''
... <ldml>
... <layout>
- ... <orientation lines="bottom-to-top" characters="right-to-left" />
+ ... <orientation lines="bottom-to-top"
+ ... characters="right-to-left" />
... </layout>
... </ldml>'''
>>> dom = parseString(xml)