[Zope3-checkins] CVS: Zope3/src/zope/schema - _field.py:1.30 _schema.py:1.8 interfaces.py:1.41

Jim Fulton jim at zope.com
Fri Mar 5 17:10:03 EST 2004


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

Modified Files:
	_field.py _schema.py interfaces.py 
Log Message:
Renamed interface methods:

isImplementedByInstancesOf to implementedBy
  isImplementedBy            to providedBy


=== Zope3/src/zope/schema/_field.py 1.29 => 1.30 ===
--- Zope3/src/zope/schema/_field.py:1.29	Tue Mar  2 09:27:14 2004
+++ Zope3/src/zope/schema/_field.py	Fri Mar  5 17:09:31 2004
@@ -187,7 +187,7 @@
 
     def _validate(self, value):
         super(InterfaceField, self)._validate(value)
-        if not IInterface.isImplementedBy(value):
+        if not IInterface.providedBy(value):
             raise ValidationError(WrongType)
 
 def _validate_sequence(value_type, value, errors=None):
@@ -223,7 +223,7 @@
     def __init__(self, value_type=None, **kw):
         super(Sequence, self).__init__(**kw)
         # whine if value_type is not a field
-        if value_type is not None and not IField.isImplementedBy(value_type):
+        if value_type is not None and not IField.providedBy(value_type):
             raise ValueError, "'value_type' must be field instance."
         self.value_type = value_type
 
@@ -251,10 +251,10 @@
     if errors is None:
         errors = []  
     for name in schema.names(all=True):
-        if not IMethod.isImplementedBy(schema[name]):
+        if not IMethod.providedBy(schema[name]):
             try:
                 attribute = schema[name]
-                if IField.isImplementedBy(attribute):
+                if IField.providedBy(attribute):
                     # validate attributes that are fields  
                     attribute.validate(getattr(value, name))
             except ValidationError, error:
@@ -271,7 +271,7 @@
     implements(IObject)
 
     def __init__(self, schema, **kw):
-        if not IInterface.isImplementedBy(schema):
+        if not IInterface.providedBy(schema):
             raise ValidationError(WrongType)
             
         self.schema = schema
@@ -281,7 +281,7 @@
         super(Object, self)._validate(value)
         
         # schema has to be implemented by value    
-        if not self.schema.isImplementedBy(value):
+        if not self.schema.providedBy(value):
             raise ValidationError(errornames.SchemaNotProvided)
             
         # check the value against  schema
@@ -300,9 +300,9 @@
     def __init__(self, key_type=None, value_type=None, **kw):
         super(Dict, self).__init__(**kw)
         # whine if key_type or value_type is not a field
-        if key_type is not None and not IField.isImplementedBy(key_type):
+        if key_type is not None and not IField.providedBy(key_type):
             raise ValueError, "'key_type' must be field instance."
-        if value_type is not None and not IField.isImplementedBy(value_type):
+        if value_type is not None and not IField.providedBy(value_type):
             raise ValueError, "'value_type' must be field instance."
         self.key_type = key_type
         self.value_type = value_type


=== Zope3/src/zope/schema/_schema.py 1.7 => 1.8 ===
--- Zope3/src/zope/schema/_schema.py:1.7	Mon May 12 06:02:41 2003
+++ Zope3/src/zope/schema/_schema.py	Fri Mar  5 17:09:31 2004
@@ -19,7 +19,7 @@
     """Return a list of all the Field names in a schema.
     """
     from zope.schema.interfaces import IField
-    return [ name for name in schema if IField.isImplementedBy(schema[name]) ]
+    return [name for name in schema if IField.providedBy(schema[name])]
 
 def getFields(schema):
     """Return a dictionary containing all the Fields in a schema.
@@ -28,7 +28,7 @@
     fields = {}
     for name in schema:
         attr = schema[name]
-        if IField.isImplementedBy(attr):
+        if IField.providedBy(attr):
             fields[name] = attr
     return fields
 


=== Zope3/src/zope/schema/interfaces.py 1.40 => 1.41 ===
--- Zope3/src/zope/schema/interfaces.py:1.40	Sat Feb 14 18:35:59 2004
+++ Zope3/src/zope/schema/interfaces.py	Fri Mar  5 17:09:31 2004
@@ -343,7 +343,7 @@
     """
 
 def _is_field(value):
-    if not IField.isImplementedBy(value):
+    if not IField.providedBy(value):
         return False
     return True
 




More information about the Zope3-Checkins mailing list