diff babel/messages/catalog.py @ 354:1355e4014496

Moved PYTHON_FORMAT back to catalog.
author aronacher
date Tue, 17 Jun 2008 20:07:08 +0000
parents 20d10066a42a
children e989a5f2fdff
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