[Zope3-checkins] CVS: Zope3/src/zodb/btrees - interfaces.py:1.3

Jeremy Hylton jeremy@zope.com
Thu, 9 Jan 2003 12:41:56 -0500


Update of /cvs-repository/Zope3/src/zodb/btrees
In directory cvs.zope.org:/tmp/cvs-serv18293

Modified Files:
	interfaces.py 
Log Message:
Partial repair of all sorts of broken code in zodb.btrees.interfaces.

Change Interface to zope.interface.
XXX Delete references to Interface.Standard.  Does this still exist?
Don't set interfaces on OOBTree.  It's not possible to set attributes
  on these objects, and a circular import would prevent it from
  working anyway.


=== Zope3/src/zodb/btrees/interfaces.py 1.2 => 1.3 ===
--- Zope3/src/zodb/btrees/interfaces.py:1.2	Wed Dec 25 09:12:16 2002
+++ Zope3/src/zodb/btrees/interfaces.py	Thu Jan  9 12:41:54 2003
@@ -11,9 +11,8 @@
 # FOR A PARTICULAR PURPOSE.
 #
 ##############################################################################
-import Interface, Interface.Standard
-from zodb.btrees import OOBTree
 from transaction.interfaces import ConflictError
+from zope.interface import Interface
 
 class BTreesConflictError(ConflictError):
 
@@ -43,7 +42,7 @@
         return "BTrees conflict error at %d/%d/%d: %s" % (
             self.p1, self.p2, self.p3, self.msgs[self.reason])
 
-class ICollection(Interface.Interface):
+class ICollection(Interface):
 
     def clear():
         """Remove all of the items from the collection"""
@@ -55,7 +54,7 @@
         false otherwise.
         """
 
-class IReadSequence(Interface.Standard.Sequence):
+class IReadSequence(Interface):
 
     def __getslice__(index1, index2):
         """Return a subsequence from the original sequence
@@ -112,7 +111,7 @@
     def update(seq):
         """Add the items from the given sequence to the set"""
 
-class IKeySequence(IKeyed, Interface.Standard.Sized):
+class IKeySequence(IKeyed):
 
     def __getitem__(index):
         """Return the key in the given index position
@@ -128,7 +127,7 @@
     pass
 
 
-class IDictionaryIsh(IKeyed, Interface.Standard.MinimalDictionary):
+class IDictionaryIsh(IKeyed):
 
     def update(collection):
         """Add the items from the given collection object to the collection
@@ -199,7 +198,7 @@
               key=generate_key()
         """
 
-class IMerge(Interface.Interface):
+class IMerge(Interface):
     """Object with methods for merging sets, buckets, and trees.
 
     These methods are supplied in modules that define collection
@@ -330,7 +329,12 @@
 #
 ################################################################
 
-OOBTree.OOSet.__implements__ = ISet
-OOBTree.OOTreeSet.__implements__ = ITreeSet
-OOBTree.OOBucket.__implements__ = IDictionaryIsh
-OOBTree.OOBTree.__implements__ = IBTree
+# XXX These interfaces need to be set in the C code, not in Python code.
+
+# XXX You can't import OOBTree in this module, because it would create
+# a circular reference.
+
+# OOBTree.OOSet.__implements__ = ISet
+# OOBTree.OOTreeSet.__implements__ = ITreeSet
+# OOBTree.OOBucket.__implements__ = IDictionaryIsh
+# OOBTree.OOBTree.__implements__ = IBTree