diff options
-rw-r--r-- | src/zope/i18n/format.py | 3 | ||||
-rw-r--r-- | src/zope/i18n/locales/tests/test_xmlfactory.py | 10 | ||||
-rw-r--r-- | src/zope/i18n/locales/xmlfactory.py | 11 | ||||
-rw-r--r-- | src/zope/i18n/tests/test_formats.py | 9 |
4 files changed, 20 insertions, 13 deletions
diff --git a/src/zope/i18n/format.py b/src/zope/i18n/format.py index 05431e0..2a2421c 100644 --- a/src/zope/i18n/format.py +++ b/src/zope/i18n/format.py @@ -189,7 +189,8 @@ class DateTimeFormat(object): return tzinfo.localize( datetime.datetime.combine( datetime.date.today(), - datetime.time(*[e or 0 for e in ordered[3:]]))).timetz() + datetime.time(*[e or 0 for e in ordered[3:]])) + ).timetz() return datetime.time( *[e or 0 for e in ordered[3:]], **{'tzinfo': tzinfo} ) diff --git a/src/zope/i18n/locales/tests/test_xmlfactory.py b/src/zope/i18n/locales/tests/test_xmlfactory.py index 0dc070e..e11097c 100644 --- a/src/zope/i18n/locales/tests/test_xmlfactory.py +++ b/src/zope/i18n/locales/tests/test_xmlfactory.py @@ -36,9 +36,11 @@ class LocaleXMLFileTestCase(TestCase): # 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 length in getattr( + # locale.numbers, category + 'Formats' + # ).values(): # for format in length.formats.values(): - # self.assert_(parseNumberPattern(format.pattern) is not None) + # self.assertIsNotNone(parseNumberPattern(format.pattern) # Making sure all datetime patterns parse # for calendar in locale.dates.calendars.values(): @@ -47,8 +49,8 @@ class LocaleXMLFileTestCase(TestCase): # calendar, category + 'Formats' # ).values(): # for format in length.formats.values(): - # self.assert_( - # parseDateTimePattern(format.pattern) is not None + # self.assertIsNotNone( + # parseDateTimePattern(format.pattern) # ) diff --git a/src/zope/i18n/locales/xmlfactory.py b/src/zope/i18n/locales/xmlfactory.py index 0520c2d..f1ed219 100644 --- a/src/zope/i18n/locales/xmlfactory.py +++ b/src/zope/i18n/locales/xmlfactory.py @@ -381,8 +381,8 @@ class LocaleFactory(object): defaultMonthContext_node = months_node.getElementsByTagName('default') if defaultMonthContext_node: - calendar.defaultMonthContext = defaultMonthContext_node[0].getAttribute( - 'type') + calendar.defaultMonthContext = defaultMonthContext_node[ + 0].getAttribute('type') monthContext_nodes = months_node.getElementsByTagName('monthContext') if not monthContext_nodes: @@ -525,8 +525,8 @@ class LocaleFactory(object): defaultDayContext_node = days_node.getElementsByTagName('default') if defaultDayContext_node: - calendar.defaultDayContext = defaultDayContext_node[0].getAttribute( - 'type') + calendar.defaultDayContext = defaultDayContext_node[ + 0].getAttribute('type') dayContext_nodes = days_node.getElementsByTagName('dayContext') if not dayContext_nodes: @@ -904,7 +904,8 @@ class LocaleFactory(object): for formatsName, lengthName, formatName in ( ('dateFormats', 'dateFormatLength', 'dateFormat'), ('timeFormats', 'timeFormatLength', 'timeFormat'), - ('dateTimeFormats', 'dateTimeFormatLength', 'dateTimeFormat')): + ('dateTimeFormats', 'dateTimeFormatLength', + 'dateTimeFormat')): formats_nodes = cal_node.getElementsByTagName(formatsName) if formats_nodes: diff --git a/src/zope/i18n/tests/test_formats.py b/src/zope/i18n/tests/test_formats.py index 4ca039e..a266de6 100644 --- a/src/zope/i18n/tests/test_formats.py +++ b/src/zope/i18n/tests/test_formats.py @@ -787,7 +787,8 @@ class TestNumberPatternParser(_TestCase): self.assertEqual( parseNumberPattern('#,##,##0.###;-#,##,##0.###'), ((None, '', None, '#####0', '###', '', None, '', None, (3, 2, 0)), - (None, '-', None, '#####0', '###', '', None, '', None, (3, 2, 0)))) + (None, '-', None, '#####0', '###', '', None, '', None, + (3, 2, 0)))) self.assertEqual( parseNumberPattern('#,##0.##;-#,##0.##'), @@ -812,7 +813,8 @@ class TestNumberPatternParser(_TestCase): self.assertEqual( parseNumberPattern('##,##,##0.###;-##,##,##0.###'), ((None, '', None, '######0', '###', '', None, '', None, (3, 2, 0)), - (None, '-', None, '######0', '###', '', None, '', None, (3, 2, 0)))) + (None, '-', None, '######0', '###', '', None, '', None, + (3, 2, 0)))) self.assertEqual( parseNumberPattern('##,##0.##;-##,##0.##'), @@ -862,7 +864,8 @@ class TestNumberPatternParser(_TestCase): self.assertEqual( parseNumberPattern('##,##,##0.00;-##,##,##0.00'), ((None, '', None, '######0', '00', '', None, '', None, (3, 2, 0)), - (None, '-', None, '######0', '00', '', None, '', None, (3, 2, 0)))) + (None, '-', None, '######0', '00', '', None, '', None, + (3, 2, 0)))) self.assertEqual( parseNumberPattern('###0.00;-###0.00'), |