I worked a bit with ZopeHead.

Required CMF patches attached.

Jim Fulton wrote at 2003-11-30 11:28 -0500:
>Jim Fulton wrote:
>>Yuppie wrote:
>> 1.) "from ZODB import Persistent, PersistentMapping" doesn't work anymore

"Persistent" was moved from ZODB into "Persistence".
Had to modify DC-Workflow.

> ...
>> 3.) 'rebinding by assignment' doesn't work anymore
>> 
>> With oldstyle ExtensionClasses you were able to rebind methods by 
>> assignment, without subclassing from the class that defines the method.
>> 
>> CMFCore/FSPageTemplate.py seems to be a good use case for that feature:
>> 
>> class FSPageTemplate(FSObject, Script, PageTemplate):
>>     pt_getContext = ZopePageTemplate.pt_getContext

This is still possible but only for subclasses of assigned methods.
Appending ".im_func" removes this restriction.

> ...
>> 4.) some objects publishable in Zope 2.7 aren't publishable anymore
>
>Can you give any specifics?
>
>> No big deal to add docstrings, but what's the policy change?

Apparently, the old "ExtensionClass" was ready to inherit
"__doc__" from a base class. Python 2.3 does not do this.
Thus, "__doc__" strings have to be added...

>> 5.) other issues
>> 
>> I was not able to track this error down, but maybe you've got an idea 
>> what's going wrong here?
>> 
>> http://localhost:8080/myCMFSite/portal_types/Document/manage_propertiesForm
>> Traceback (innermost last):
>>   Module ZPublisher.Publish, line 100, in publish
>>   Module ZPublisher.mapply, line 88, in mapply
>>   Module ZPublisher.Publish, line 40, in call_object
>>   Module Products.CMFCore.utils, line 350, in manage_propertiesForm
>>   Module Shared.DC.Scripts.Bindings, line 252, in __call__
>>   Module Shared.DC.Scripts.Bindings, line 281, in _bindAndExec
>>   Module Shared.DC.Scripts.Bindings, line 1, in ?
>>   Module Shared.DC.Scripts.Bindings, line 218, in _getContext
>> AttributeError: aq_parent

It is very obscure, indeed.

Not that is does not work in "Zope 2.8" but that it worked in
previous versions:

  "PropertyManager.manage_propertiesForm" ("mpF") is an
  "App.special_dtml.DTMLFile" instance.
  In "Products.CMFCore.utils.SimpleItemWithProperties.manage_propertiesForm"
  it is called by

    apply(mpF, (self, self, REQUEST,) ...)

  Apparently, former versions used the first "self" as "self" for
  the "DTMLFile" and passed the remaining arguments to "mpF"s "__call__",
  which seems really strange.

  Zope 2.8 does the natural thing: it does not change the
  "mpF"s "self" and passed all arguements to "__call__".
  As "mpF"s "self" is not acquisition wrapped, we get the
  "aq_parent" error.

A fix calls "mpF" by:

    apply(mpF.__of__(self), (self, REQUEST,) ...)


The attached patch to "CMFCore" fixes all CMF test failures with the
exception of 2 ".security" errors. These are not related to
Zope 2.8 but genuine bugs in my CMF 1.4.1 installation.

-- 
Dieter
--- /home/dieter/Haufe/src/Zope/lib/python/Products/CMFCore/FSPageTemplate.py	2003-09-30 07:30:27.000000000 +0200
+++ CMFCore/FSPageTemplate.py	2003-12-06 14:11:11.000000000 +0100
@@ -220,15 +220,20 @@
     PrincipiaSearchSource = ZopePageTemplate.PrincipiaSearchSource
 
     security.declareProtected(ViewManagementScreens, 'document_src')
-    document_src = ZopePageTemplate.document_src
+    document_src = ZopePageTemplate.document_src.im_func
 
-    pt_getContext = ZopePageTemplate.pt_getContext
+    pt_getContext = ZopePageTemplate.pt_getContext.im_func
 
-    ZScriptHTML_tryParams = ZopePageTemplate.ZScriptHTML_tryParams
+    ZScriptHTML_tryParams = ZopePageTemplate.ZScriptHTML_tryParams.im_func
 
 
-d = FSPageTemplate.__dict__
-d['source.xml'] = d['source.html'] = Src()
+# does not work with Zope 2.8
+#d = FSPageTemplate.__dict__
+#d['source.xml'] = d['source.html'] = Src()
+_s = Src()
+setattr(FSPageTemplate,'source.xml',_s)
+setattr(FSPageTemplate,'source.html',_s)
+del _s
 
 Globals.InitializeClass(FSPageTemplate)
 
--- /home/dieter/Haufe/src/Zope/lib/python/Products/CMFCore/MemberDataTool.py	2003-06-24 15:00:39.000000000 +0200
+++ CMFCore/MemberDataTool.py	2003-12-06 14:25:33.000000000 +0100
@@ -224,7 +224,7 @@
         transactions and to reduce the necessary number of
         entries.
         '''
-        self._members[id] = m
+        self._members[id] = m.aq_base
 
 InitializeClass(MemberDataTool)
 
--- /home/dieter/Haufe/src/Zope/lib/python/Products/CMFCore/CatalogTool.py	2003-09-17 07:00:53.000000000 +0200
+++ CMFCore/CatalogTool.py	2003-12-06 15:34:46.000000000 +0100
@@ -224,7 +224,7 @@
 
     manage_catalogFind = DTMLFile( 'catalogFind', _dtmldir )
 
-    def catalog_object(self, object, uid, idxs=[]):
+    def catalog_object(self, object, uid, idxs=[], update_metadata=1):
         # Wraps the object with workflow and accessibility
         # information just before cataloging.
         wf = getattr(self, 'portal_workflow', None)
@@ -233,7 +233,7 @@
         else:
             vars = {}
         w = IndexableObjectWrapper(vars, object)
-        ZCatalog.catalog_object(self, w, uid, idxs)
+        ZCatalog.catalog_object(self, w, uid, idxs, update_metadata)
 
     security.declarePrivate('indexObject')
     def indexObject(self, object):
--- /home/dieter/Haufe/src/Zope/lib/python/Products/CMFCore/utils.py	2003-09-17 07:00:54.000000000 +0200
+++ CMFCore/utils.py	2003-12-06 15:57:52.000000000 +0100
@@ -359,8 +359,8 @@
         'An override that makes the schema fixed.'
         my_kw = kw.copy()
         my_kw['property_extensible_schema__'] = 0
-        return apply(PropertyManager.manage_propertiesForm,
-                     (self, self, REQUEST,) + args, my_kw)
+        return apply(PropertyManager.manage_propertiesForm.__of__(self),
+                     (self, REQUEST,) + args, my_kw)
 
     security.declarePublic('propertyLabel')
     def propertyLabel(self, id):
--- /home/dieter/Haufe/src/Zope/lib/python/Products/CMFCore/FSDTMLMethod.py	2003-09-17 07:00:53.000000000 +0200
+++ CMFCore/FSDTMLMethod.py	2003-12-06 16:25:05.000000000 +0100
@@ -189,7 +189,7 @@
     document_src = DTMLMethod.document_src
 
     security.declareProtected(ViewManagementScreens, 'manage_haveProxy')
-    manage_haveProxy = DTMLMethod.manage_haveProxy
+    manage_haveProxy = DTMLMethod.manage_haveProxy.im_func
 
 Globals.InitializeClass(FSDTMLMethod)
 
--- /home/dieter/Haufe/src/Zope/lib/python/Products/CMFCore/FSPythonScript.py	2003-09-17 07:00:53.000000000 +0200
+++ CMFCore/FSPythonScript.py	2003-12-06 16:25:10.000000000 +0100
@@ -202,7 +202,7 @@
     def params(self): return self._params
 
     security.declareProtected(ViewManagementScreens, 'manage_haveProxy')
-    manage_haveProxy = PythonScript.manage_haveProxy
+    manage_haveProxy = PythonScript.manage_haveProxy.im_func
 
     security.declareProtected(ViewManagementScreens, 'body')
     def body(self): return self._body
--- /home/dieter/Haufe/src/Zope/lib/python/Products/CMFCore/PortalFolder.py	2003-09-17 07:00:54.000000000 +0200
+++ CMFCore/PortalFolder.py	2003-12-06 16:27:48.000000000 +0100
@@ -602,5 +602,5 @@
         """
         return '; '.join(self.description)
 
-manage_addPortalFolder = PortalFolder.manage_addPortalFolder
+manage_addPortalFolder = PortalFolder.manage_addPortalFolder.im_func
 manage_addPortalFolderForm = DTMLFile( 'folderAdd', globals() )
--- /home/dieter/Haufe/src/Zope/lib/python/Products/CMFCore/tests/test_DirectoryView.py	2003-09-17 07:00:55.000000000 +0200
+++ CMFCore/tests/test_DirectoryView.py	2003-12-06 16:59:15.000000000 +0100
@@ -1,4 +1,5 @@
 from unittest import TestCase, TestSuite, makeSuite, main
+import time
 
 import Zope
 try:
@@ -140,6 +141,9 @@
         # initialise skins
         self._registerDirectory(self)
 
+        # sleep a bit to work around limited time resolution problem
+        time.sleep(1)
+
         # add a method to the fake skin folder
         self._writeFile(self.test2path, "return 'test2'")
 
@@ -185,6 +189,9 @@
         """
         remove(self.test2path)
         self.failIf(hasattr(self.ob.fake_skin,'test2'))
+
+        # sleep a bit to work around limited time resolution problem
+        time.sleep(1)
             
         # add method back to the fake skin folder
         self._writeFile(self.test2path, "return 'test2.2'")
@@ -192,6 +199,8 @@
         # check
         self.assertEqual(self.ob.fake_skin.test2(),'test2.2')
 
+        # sleep a bit to work around limited time resolution problem
+        time.sleep(1)
         
         # edit method
         self._writeFile(self.test2path, "return 'test2.3'")
--- /home/dieter/Haufe/src/Zope/lib/python/Products/CMFCore/tests/test_FSSecurity.py	2003-06-10 09:11:37.000000000 +0200
+++ CMFCore/tests/test_FSSecurity.py	2003-12-06 17:17:30.000000000 +0100
@@ -87,6 +87,7 @@
             """ Test adding of a .security """
             # baseline
             self._checkSettings(self.ob.fake_skin.test5,'View',1,[])
+            sleep(1) # to counter limited time resolution
             # add
             self._writeFile('test5.py.security','View:acquire:Manager')
             # test            
@@ -96,9 +97,11 @@
             """ Test deleting of a .security """
             # baseline
             self._checkSettings(self.ob.fake_skin.test5,'View',1,[])
+            sleep(1) # to counter limited time resolution
             self._writeFile('test5.py.security','View:acquire:Manager')
             self._checkSettings(self.ob.fake_skin.test5,'View',1,['Manager'])
             # delete
+            sleep(1) # to counter limited time resolution
             self._deleteFile('test5.py.security')
             # test
             self._checkSettings(self.ob.fake_skin.test5,'View',1,[])
@@ -115,6 +118,7 @@
             self._writeFile('test5.py.security','View::Manager,Anonymous')
             self._checkSettings(self.ob.fake_skin.test5,'View',0,['Manager','Anonymous'])           
             # edit
+            sleep(1) # to counter limited time resolution
             self._writeFile('test5.py.security','View:acquire:Manager')
             # test
             self._checkSettings(self.ob.fake_skin.test5,'View',1,['Manager'])
@@ -138,6 +142,7 @@
             self._checkSettings(self.ob.fake_skin.test5,'View',0,['Manager','Anonymous'])
 
             # edit
+            sleep(1) # see above
             self._writeFile('test5.py.security','View:acquire:Manager')
             # test
             self._checkSettings(self.ob.fake_skin.test5,'View',1,['Manager'])
--- /home/dieter/Haufe/src/Zope/lib/python/Products/CMFCore/tests/base/tidata.py	2003-09-16 10:04:53.000000000 +0200
+++ CMFCore/tests/base/tidata.py	2003-12-06 16:40:34.000000000 +0100
@@ -283,11 +283,11 @@
 ##bind namespace=
 ##bind script=script
 ##bind subpath=traverse_subpath
-##parameters=container, id
+##parameters=container_, id
 ##title=
 ##
-product = container.manage_addProduct['FooProduct']
+product = container_.manage_addProduct['FooProduct']
 product.addFoo(id)
-item = getattr(container, id)
+item = getattr(container_, id)
 return item
 """
_______________________________________________
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )

Reply via email to