[ZODB-Dev] PEAK integration patch

Bob Ippolito bob at redivi.com
Sun Feb 22 03:31:45 EST 2004


I'm attempting to migrate PEAK's ( http://peak.telecommunity.com/ ) 
transaction/persistence facilities from a ZODB4 base to the current 
ZODB CVS HEAD (ZODB 3.3).  Since the persistent and Persistence modules 
are largely the same, it's a trivial change.  However, if 
zope.components isn't installed, then it doesn't work because 
PyProtocols has zope.components integration but it can't integrate with 
the arbitrary filler classes.  The following patch tries 
zope.components first, then PyProtocols, before giving up and creating 
the fillers:

Index: src/persistent/interfaces.py
===================================================================
RCS file: /cvs-repository/ZODB/src/persistent/interfaces.py,v
retrieving revision 1.2
diff -u -r1.2 interfaces.py
--- src/persistent/interfaces.py        19 Feb 2004 02:59:30 -0000      
1.2
+++ src/persistent/interfaces.py        22 Feb 2004 08:21:14 -0000
@@ -16,14 +16,16 @@
      from zope.interface import Interface
      from zope.interface import Attribute
  except ImportError:
+    try:
+        from protocols import Interface, Attribute
+    except ImportError:
+        # just allow the module to compile if zope isn't available

-    # just allow the module to compile if zope isn't available
+        class Interface(object):
+            pass

-    class Interface(object):
-        pass
-
-    def Attribute(s):
-        return s
+        def Attribute(s):
+            return s

  class IPersistent(Interface):
      """Python persistent interface




More information about the ZODB-Dev mailing list