[Zope3-checkins] CVS: Packages3/Interface/Common - Mapping.py:1.6 __init__.py:1.4

Jim Fulton jim@zope.com
Fri, 18 Apr 2003 06:03:50 -0400


Update of /cvs-repository/Packages3/Interface/Common
In directory cvs.zope.org:/tmp/cvs-serv27994/Common

Added Files:
	Mapping.py __init__.py 
Log Message:
committing z2 sources in preparation for z3 compatability layer over zope.interface

=== Packages3/Interface/Common/Mapping.py 1.5 => 1.6 ===
--- /dev/null	Fri Apr 18 06:03:50 2003
+++ Packages3/Interface/Common/Mapping.py	Fri Apr 18 06:03:19 2003
@@ -0,0 +1,60 @@
+##############################################################################
+#
+# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.0 (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.
+#
+##############################################################################
+"""
+
+Revision information:
+$Id$
+"""
+
+from Interface import Interface
+
+class IReadMapping(Interface):
+    """Basic mapping interface
+    """
+
+    def __getitem__(key):
+        """Get a value for a key
+
+        A KeyError is raised if there is no value for the key.
+        """
+
+    def get(key, default=None):
+        """Get a value for a key
+
+        The default is returned if there is no value for the key.
+        """
+
+    def has_key(key):
+        """Tell if a key exists in the mapping
+        """
+
+class IEnumerableMapping(IReadMapping):
+    """Mapping objects whose items can be enumerated
+    """
+
+    def keys():
+        """Return the keys of the mapping object
+        """
+
+    def values():
+        """Return the values of the mapping object
+        """
+
+    def items():
+        """Return the items of the mapping object
+        """
+
+    def __len__():
+        """Return the number of items
+        """


=== Packages3/Interface/Common/__init__.py 1.3 => 1.4 ===
--- /dev/null	Fri Apr 18 06:03:50 2003
+++ Packages3/Interface/Common/__init__.py	Fri Apr 18 06:03:19 2003
@@ -0,0 +1,13 @@
+##############################################################################
+#
+# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.0 (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.
+#
+##############################################################################