[Zope3-checkins] CVS: Zope3/src/zope/schema - _bootstrapfields.py:1.13.4.1 _field.py:1.11.4.1 accessors.py:1.1.4.1

Jim Fulton jim@zope.com
Fri, 18 Apr 2003 22:46:21 -0400


Update of /cvs-repository/Zope3/src/zope/schema
In directory cvs.zope.org:/tmp/cvs-serv13310/src/zope/schema

Modified Files:
      Tag: interfacegeddon-branch
	_bootstrapfields.py _field.py accessors.py 
Log Message:
committing work in progress to interfacegeddon branch.



=== Zope3/src/zope/schema/_bootstrapfields.py 1.13 => 1.13.4.1 ===
--- Zope3/src/zope/schema/_bootstrapfields.py:1.13	Mon Apr 14 16:02:31 2003
+++ Zope3/src/zope/schema/_bootstrapfields.py	Fri Apr 18 22:46:20 2003
@@ -18,8 +18,7 @@
 
 import warnings
 
-from zope.interface import Attribute
-from zope.interface.implements import visitImplements
+from zope.interface import Attribute, providedBy
 
 from zope.schema.interfaces import StopValidation, ValidationError
 from zope.schema._schema import getFields
@@ -104,10 +103,12 @@
         # should be the same type
         if type(self) != type(other):
             return False
+
         # should have the same properties
         names = {} # used as set of property names, ignoring values
-        visitImplements(self.__implements__, self,
-                        lambda interface: names.update(getFields(interface)))
+        for interface in providedBy(self):
+            names.update(getFields(interface))
+            
         # order will be different always, don't compare it
         if 'order' in names:
             del names['order']


=== Zope3/src/zope/schema/_field.py 1.11 => 1.11.4.1 ===
--- Zope3/src/zope/schema/_field.py:1.11	Mon Apr 14 16:02:31 2003
+++ Zope3/src/zope/schema/_field.py	Fri Apr 18 22:46:20 2003
@@ -18,7 +18,7 @@
 
 import warnings
 
-from zope.interface.implements import implements
+from zope.interface import classImplements
 
 from zope.schema.interfaces import ValidationError
 from zope.schema.errornames import WrongContainedType
@@ -45,18 +45,18 @@
 Field.required    = FieldProperty(IField['required'])
 Field.readonly    = FieldProperty(IField['readonly'])
 # Default is already taken care of
-implements(Field, IField)
+classImplements(Field, IField)
 
 MinMaxLen.min_length = FieldProperty(IMinMaxLen['min_length'])
 MinMaxLen.max_length = FieldProperty(IMinMaxLen['max_length'])
 
-implements(Text, IText)
-implements(TextLine, ITextLine)
-implements(Password, IPassword)
-implements(Bool, IBool)
-implements(Int, IInt)
-implements(EnumeratedInt, IEnumeratedInt)
-implements(EnumeratedTextLine, IEnumeratedTextLine)
+classImplements(Text, IText)
+classImplements(TextLine, ITextLine)
+classImplements(Password, IPassword)
+classImplements(Bool, IBool)
+classImplements(Int, IInt)
+classImplements(EnumeratedInt, IEnumeratedInt)
+classImplements(EnumeratedTextLine, IEnumeratedTextLine)
 
 class SourceText(Text):
     __doc__ = ISourceText.__doc__


=== Zope3/src/zope/schema/accessors.py 1.1 => 1.1.4.1 ===
--- Zope3/src/zope/schema/accessors.py:1.1	Mon Apr 14 04:21:16 2003
+++ Zope3/src/zope/schema/accessors.py	Fri Apr 18 22:46:20 2003
@@ -40,7 +40,10 @@
 
 from __future__ import generators
 
+from zope.interface import providedBy
+from zope.interface import directlyProvides
 from zope.interface.interface import Method
+        
 
 class FieldReadAccessor(Method):
     """Field read accessor
@@ -50,11 +53,14 @@
     # A read accessor is a decorator of a field, using the given
     # fields proprtyoes to provide meta data.
 
+    def __provides__(self):
+        return providedBy(self.field)
+    __provides__ = property(__provides__)
+
     def __init__(self, field):
         self.field = field
         Method.__init__(self, '')
         self.__doc__ = 'get %s' % field.__doc__
-        self.__implements__ = field.__implements__, Method.__implements__
 
     def getSignatureString(self):
         return '()'