[Checkins] SVN: zope.schema/trunk/ Made the dependency on ``zope.i18nmessageid`` optional.

Tres Seaver tseaver at palladion.com
Mon Apr 5 22:56:43 EDT 2010


Log message for revision 110534:
  Made the dependency on ``zope.i18nmessageid`` optional.
  

Changed:
  U   zope.schema/trunk/CHANGES.txt
  U   zope.schema/trunk/setup.py
  U   zope.schema/trunk/src/zope/schema/_bootstrapinterfaces.py
  A   zope.schema/trunk/src/zope/schema/_messageid.py
  U   zope.schema/trunk/src/zope/schema/interfaces.py
  U   zope.schema/trunk/src/zope/schema/tests/test_objectfield.py

-=-
Modified: zope.schema/trunk/CHANGES.txt
===================================================================
--- zope.schema/trunk/CHANGES.txt	2010-04-06 01:13:49 UTC (rev 110533)
+++ zope.schema/trunk/CHANGES.txt	2010-04-06 02:56:41 UTC (rev 110534)
@@ -5,7 +5,7 @@
 3.6.2 (unreleased)
 ------------------
 
-- ...
+- Made the dependency on ``zope.i18nmessageid`` optional.
 
 3.6.1 (2010-01-05)
 ------------------

Modified: zope.schema/trunk/setup.py
===================================================================
--- zope.schema/trunk/setup.py	2010-04-06 01:13:49 UTC (rev 110533)
+++ zope.schema/trunk/setup.py	2010-04-06 02:56:41 UTC (rev 110534)
@@ -84,7 +84,6 @@
       extras_require={'test': ['zope.testing'],
                       'docs': ['z3c.recipe.sphinxdoc']},
       install_requires=['setuptools',
-                        'zope.i18nmessageid',
                         'zope.interface',
                         'zope.event',
                        ],

Modified: zope.schema/trunk/src/zope/schema/_bootstrapinterfaces.py
===================================================================
--- zope.schema/trunk/src/zope/schema/_bootstrapinterfaces.py	2010-04-06 01:13:49 UTC (rev 110533)
+++ zope.schema/trunk/src/zope/schema/_bootstrapinterfaces.py	2010-04-06 02:56:41 UTC (rev 110534)
@@ -17,8 +17,7 @@
 """
 import zope.interface
 
-from zope.i18nmessageid import MessageFactory
-_ = MessageFactory("zope")
+from zope.schema._messageid import _
 
 class StopValidation(Exception):
     """Raised if the validation is completed early.

Copied: zope.schema/trunk/src/zope/schema/_messageid.py (from rev 109377, zope.schema/branches/tseaver-optional_i18nmessageid/src/zope/schema/_messageid.py)
===================================================================
--- zope.schema/trunk/src/zope/schema/_messageid.py	                        (rev 0)
+++ zope.schema/trunk/src/zope/schema/_messageid.py	2010-04-06 02:56:41 UTC (rev 110534)
@@ -0,0 +1,20 @@
+##############################################################################
+#
+# Copyright (c) 2000 Zope Foundation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+
+try:
+    from zope.i18nmessageid import MessageFactory
+except ImportError:
+    _ = lambda x: unicode(x)
+else:
+    _ = MessageFactory("zope")

Modified: zope.schema/trunk/src/zope/schema/interfaces.py
===================================================================
--- zope.schema/trunk/src/zope/schema/interfaces.py	2010-04-06 01:13:49 UTC (rev 110533)
+++ zope.schema/trunk/src/zope/schema/interfaces.py	2010-04-06 02:56:41 UTC (rev 110534)
@@ -18,21 +18,31 @@
 __docformat__ = "reStructuredText"
 
 from zope.interface import Interface, Attribute
-from zope.schema._bootstrapfields import Container, Iterable
-from zope.schema._bootstrapfields import Field, Text, TextLine, Bool, Int
 
-from zope.i18nmessageid import MessageFactory
-_ = MessageFactory("zope")
+from zope.schema._messageid import _
 
 # Import from _bootstrapinterfaces only because other packages will expect
 # to find these interfaces here.
-from zope.schema._bootstrapinterfaces import StopValidation, ValidationError
+from zope.schema._bootstrapfields import Field
+from zope.schema._bootstrapfields import Container
+from zope.schema._bootstrapfields import Iterable
+from zope.schema._bootstrapfields import Text
+from zope.schema._bootstrapfields import TextLine
+from zope.schema._bootstrapfields import TextLine
+from zope.schema._bootstrapfields import Bool
+from zope.schema._bootstrapfields import Int
+from zope.schema._bootstrapinterfaces import StopValidation
+from zope.schema._bootstrapinterfaces import ValidationError
 from zope.schema._bootstrapinterfaces import IFromUnicode
-from zope.schema._bootstrapinterfaces import RequiredMissing, WrongType
+from zope.schema._bootstrapinterfaces import RequiredMissing
+from zope.schema._bootstrapinterfaces import WrongType
 from zope.schema._bootstrapinterfaces import ConstraintNotSatisfied
-from zope.schema._bootstrapinterfaces import NotAContainer, NotAnIterator
-from zope.schema._bootstrapinterfaces import TooSmall, TooBig
-from zope.schema._bootstrapinterfaces import TooShort, TooLong
+from zope.schema._bootstrapinterfaces import NotAContainer
+from zope.schema._bootstrapinterfaces import NotAnIterator
+from zope.schema._bootstrapinterfaces import TooSmall
+from zope.schema._bootstrapinterfaces import TooBig
+from zope.schema._bootstrapinterfaces import TooLong
+from zope.schema._bootstrapinterfaces import TooShort
 from zope.schema._bootstrapinterfaces import InvalidValue
 
 class WrongContainedType(ValidationError):

Modified: zope.schema/trunk/src/zope/schema/tests/test_objectfield.py
===================================================================
--- zope.schema/trunk/src/zope/schema/tests/test_objectfield.py	2010-04-06 01:13:49 UTC (rev 110533)
+++ zope.schema/trunk/src/zope/schema/tests/test_objectfield.py	2010-04-06 02:56:41 UTC (rev 110534)
@@ -18,7 +18,6 @@
 from unittest import TestSuite, main, makeSuite
 
 import zope.event
-from zope.i18nmessageid import MessageFactory
 from zope.interface import Attribute, Interface, implements
 from zope.schema import Object, TextLine
 from zope.schema.fieldproperty import FieldProperty
@@ -29,7 +28,7 @@
 from zope.schema.interfaces import IBeforeObjectAssignedEvent
 from zope.testing.cleanup import CleanUp
 
-_ = MessageFactory('zope')
+from zope.schema._messageid import _
 
 
 class ITestSchema(Interface):



More information about the checkins mailing list