diff babel/messages/catalog.py @ 356:ed20c467d223

Moved PYTHON_FORMAT back to catalog.
author aronacher
date Tue, 17 Jun 2008 20:07:08 +0000
parents 249aab27c4b3
children 9acf6b5baa22
line wrap: on
line diff
--- a/babel/messages/catalog.py
+++ b/babel/messages/catalog.py
@@ -28,13 +28,24 @@
 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."""
 
Copyright (C) 2012-2017 Edgewall Software