comparison babel/messages/catalog.py @ 227:f358dd40a960

Applied patch by Ramiro Morales for more extensive detection of Python string formatting specifiers. Closes #57.
author cmlenz
date Fri, 20 Jul 2007 12:52:40 +0000
parents bd8b1301b27e
children 629357c88d59
comparison
equal deleted inserted replaced
226:9d7cc01b49c2 227:f358dd40a960
31 from babel.util import odict, LOCALTZ, UTC, FixedOffsetTimezone 31 from babel.util import odict, LOCALTZ, UTC, FixedOffsetTimezone
32 32
33 __all__ = ['Message', 'Catalog', 'TranslationError'] 33 __all__ = ['Message', 'Catalog', 'TranslationError']
34 __docformat__ = 'restructuredtext en' 34 __docformat__ = 'restructuredtext en'
35 35
36 PYTHON_FORMAT = re.compile(r'\%(\([\w]+\))?[diouxXeEfFgGcrs]') 36 PYTHON_FORMAT = re.compile(r'\%(\([\w]+\))?([-#0\ +])?(\*|[\d]+)?(\.(\*|[\d]+))?([hlL])?[diouxXeEfFgGcrs]')
37 37
38 38
39 class Message(object): 39 class Message(object):
40 """Representation of a single message in a catalog.""" 40 """Representation of a single message in a catalog."""
41 41
Copyright (C) 2012-2017 Edgewall Software