[Zope3-checkins] CVS: Zope3/src/zope/app/interfaces - container.py:1.6

Jim Fulton cvs-admin at zope.org
Mon Dec 1 11:19:24 EST 2003


Update of /cvs-repository/Zope3/src/zope/app/interfaces
In directory cvs.zope.org:/tmp/cvs-serv11281/src/zope/app/interfaces

Modified Files:
	container.py 
Log Message:
Added exceptions to be raised when containment constraints are violated.


=== Zope3/src/zope/app/interfaces/container.py 1.5 => 1.6 ===
--- Zope3/src/zope/app/interfaces/container.py:1.5	Mon Sep 22 17:05:13 2003
+++ Zope3/src/zope/app/interfaces/container.py	Mon Dec  1 11:19:23 2003
@@ -16,7 +16,7 @@
 $Id$
 """
 
-from zope.interface import Interface, Attribute, implements
+from zope.interface import Interface, Attribute, implements, Invalid
 from zope.component.interfaces import IView
 from zope.interface.common.mapping import IItemMapping
 from zope.interface.common.mapping import IReadMapping, IEnumerableMapping
@@ -29,6 +29,17 @@
 class ContainerError(Exception):
     """An error of a container with one of its components."""
 
+class InvalidContainerType(Invalid, TypeError):
+    """The type of a container is not valid
+    """
+
+class InvalidItemType(Invalid, TypeError):
+    """The type of an item is not valid
+    """
+
+class InvalidType(Invalid, TypeError):
+    """The type of an object is not valid
+    """
 
 class IContained(ILocation):
     """Objects contained in containers




More information about the Zope3-Checkins mailing list