[Zope-CMF] GenericSetup BBB issues

Tres Seaver tseaver at palladion.com
Fri Apr 28 07:45:39 EDT 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I have need of using GenericSetup 1.1 on an older Zope / Five (2.8.6,
1.0.3), and found I needed to patch around some BBB breakage in imports
/ ZCML.  In particular:

=== Products/GenericSetup/utils.py 1.1 => 1.1.2.1 ===
- --- Products/GenericSetup/utils.py:1.1	Thu Apr 27 15:42:46 2006
+++ Products/GenericSetup/utils.py	Thu Apr 27 15:44:10 2006
@@ -33,9 +33,12 @@
 from Globals import package_home
 try:
     from OFS.interfaces import IOrderedContainer
- -except:
+except ImportError:
     #BBB: for Zope 2.8
- -    from Products.Five.bbb.OFS_interfaces import IOrderedContainer
+    try:
+        from Products.Five.bbb.OFS_interfaces import IOrderedContainer
+    except ImportError:
+        from Products.Five.interfaces import IOrderedContainer
 from cgi import escape
 from zope.component import queryMultiAdapter
 from zope.interface import implements


=== Products/GenericSetup/OFSP/configure.zcml 1.1 => 1.1.2.1 ===
- --- Products/GenericSetup/OFSP/configure.zcml:1.1	Thu Apr 27 15:42:48 2006
+++ Products/GenericSetup/OFSP/configure.zcml	Thu Apr 27 15:44:10 2006
@@ -5,7 +5,7 @@
   <adapter
       factory=".exportimport.FolderXMLAdapter"
       provides="Products.GenericSetup.interfaces.IBody"
- -      for="OFS.interfaces.IFolder
+      for=".exportimport.IFolder
            Products.GenericSetup.interfaces.ISetupEnviron"
       />


=== Products/GenericSetup/OFSP/exportimport.py 1.1 => 1.1.2.1 ===
- --- Products/GenericSetup/OFSP/exportimport.py:1.1	Thu Apr 27 15:42:48
2006
+++ Products/GenericSetup/OFSP/exportimport.py	Thu Apr 27 15:44:10 2006
@@ -19,7 +19,13 @@
 from Products.GenericSetup.utils import ObjectManagerHelpers
 from Products.GenericSetup.utils import PropertyManagerHelpers

- -from OFS.interfaces import IFolder
+try:
+    from OFS.interfaces import IFolder
+except ImportError: # BBB
+    try:
+        from Products.Five.bbb.interfaces import IFolder
+    except ImportError: # BBB
+        from Products.Five.interfaces import IFolder


 class FolderXMLAdapter(XMLAdapterBase, ObjectManagerHelpers,


Even after this patch, a number of the GenericSetup unit tests fail
(mostly, in the sub-packages), but enough stuff works that I can move
forward.

Any objections to landing it on the 1.1 branch, as well as the trunk?  I
don't recall that we had a specific Zope / Five version designated as
"minimum required version" for GenericSetup (as opposed to CMF 2.0).


Tres.
- --
===================================================================
Tres Seaver          +1 202-558-7113          tseaver at palladion.com
Palladion Software   "Excellence by Design"    http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFEUgBj+gerLs4ltQ4RApfVAJ9Y/J8xcfu/TkBpy1UHZd44mf0dLQCfZkeo
y5lI7ItQMbnoCnZIqtEvUK4=
=uSXk
-----END PGP SIGNATURE-----



More information about the Zope-CMF mailing list