territory = 'ZZ' # invalid/unknown
territory_name = locale.territories[territory]
if not return_city and territory and len(get_global('territory_zones').get(territory, [])) == 1:
- return region_format % (territory_name)
+ return region_format % territory_name
# Otherwise, include the city in the output
fallback_format = locale.zone_formats['fallback']
elif char == 'H':
return self.value.hour
elif char == 'h':
- return (self.value.hour % 12 or 12)
+ return self.value.hour % 12 or 12
elif char == 'm':
return self.value.minute
elif char == 'a':
"""Compare Messages, taking into account plural ids"""
def values_to_compare(obj):
if isinstance(obj, Message) and obj.pluralizable:
- return (obj.id[0], obj.context or '')
- return (obj.id, obj.context or '')
+ return obj.id[0], obj.context or ''
+ return obj.id, obj.context or ''
return cmp(values_to_compare(self), values_to_compare(other))
def __gt__(self, other):
method = extractors[method]
method_map[idx] = (pattern, method)
- return (method_map, options_map)
+ return method_map, options_map
def parse_keywords(strings=[]):
def test_update_message_changed_to_simple(self):
cat = catalog.Catalog()
- cat.add((u'foo' u'foos'), (u'Voh', u'Vöhs'))
+ cat.add(u'foo' u'foos', (u'Voh', u'Vöhs'))
tmpl = catalog.Catalog()
tmpl.add(u'foo')
cat.update(tmpl)
messages = list(extract.extract_python(buf,
extract.DEFAULT_KEYWORDS.keys(),
[], {}))
- self.assertEqual([(1, '_', (u'pylons'), []),
+ self.assertEqual([(1, '_', u'pylons', []),
(2, 'ngettext', (u'elvis', u'elvises', None), []),
(3, 'ngettext', (u'elvis', u'elvises', None), [])],
messages)
self.assertEqual((None, u'hello', u'there'), messages[2][2])
self.assertEqual((None, None), messages[3][2])
self.assertEqual(None, messages[4][2])
- self.assertEqual(('foo'), messages[5][2])
+ self.assertEqual('foo', messages[5][2])
def test_utf8_message(self):
buf = BytesIO(u"""
assert not os.path.isfile(mo_file), 'Expected no file at %r' % mo_file
self.assertEqual("""\
catalog %s is marked as fuzzy, skipping
-""" % (po_file), sys.stderr.getvalue())
+""" % po_file, sys.stderr.getvalue())
def test_compile_fuzzy_catalog(self):
po_file = self._po_file('de_DE')