[Zope3-checkins] CVS: Zope3/src/zope/schema - errornames.py:1.5
interfaces.py:1.32
Anthony Baxter
anthony at interlink.com.au
Fri Sep 19 02:47:54 EDT 2003
Update of /cvs-repository/Zope3/src/zope/schema
In directory cvs.zope.org:/tmp/cvs-serv4257
Modified Files:
errornames.py interfaces.py
Log Message:
Quoting from zope/schemas/README.txt:
The ``zope.schema`` package only depends on the ``zope.interface``
package.
Made this actually true again. If you add zope.i18n to zope.schema or
zope.interface, please make sure to wrap it in a try/except so that
these packages continue to be useful outside Zope.
=== Zope3/src/zope/schema/errornames.py 1.4 => 1.5 ===
--- Zope3/src/zope/schema/errornames.py:1.4 Tue Jul 15 15:34:43 2003
+++ Zope3/src/zope/schema/errornames.py Fri Sep 19 02:47:53 2003
@@ -20,8 +20,12 @@
as the strings are only defined in one place. Otherwise, this module
serves no real function.
"""
-from zope.i18n import MessageIDFactory
-_ = MessageIDFactory('zope')
+try:
+ from zope.i18n import MessageIDFactory
+ _ = MessageIDFactory("zope")
+except ImportError:
+ import gettext
+ gettext.install(domain='zope')
WrongType = _(u'Wrong type')
=== Zope3/src/zope/schema/interfaces.py 1.31 => 1.32 ===
--- Zope3/src/zope/schema/interfaces.py:1.31 Mon Aug 25 14:59:44 2003
+++ Zope3/src/zope/schema/interfaces.py Fri Sep 19 02:47:53 2003
@@ -16,9 +16,13 @@
$Id$
"""
from zope.interface import Interface, Attribute
-from zope.i18n import MessageIDFactory
+try:
+ from zope.i18n import MessageIDFactory
+ _ = MessageIDFactory("zope")
+except ImportError:
+ import gettext
+ gettext.install(domain='zope')
-_ = MessageIDFactory("zope")
class StopValidation(Exception):
More information about the Zope3-Checkins
mailing list