from babel.core import Locale
from babel.dates import format_datetime
from babel.messages.plurals import PLURALS
-from babel.util import odict, distinct, LOCALTZ, UTC, FixedOffsetTimezone, \
- PYTHON_FORMAT
+from babel.util import odict, distinct, LOCALTZ, UTC, FixedOffsetTimezone
__all__ = ['Message', 'Catalog', 'TranslationError']
__docformat__ = 'restructuredtext en'
+PYTHON_FORMAT = re.compile(r'''(?x)
+ \%
+ (?:\(([\w]*)\))?
+ (
+ [-#0\ +]?(?:\*|[\d]+)?
+ (?:\.(?:\*|[\d]+))?
+ [hlL]?
+ )
+ ([diouxXeEfFgGcrs%])
+''')
+
+
class Message(object):
"""Representation of a single message in a catalog."""
__docformat__ = 'restructuredtext en'
-PYTHON_FORMAT = re.compile(r'''(?x)
- \%
- (?:\(([\w]*)\))?
- (
- [-#0\ +]?(?:\*|[\d]+)?
- (?:\.(?:\*|[\d]+))?
- [hlL]?
- )
- ([diouxXeEfFgGcrs%])
-''')
-
def distinct(iterable):
"""Yield all items in an iterable collection that are distinct.