[Zope-dev] Re: New-style ExtensionClasses (Zope 2.8) -- MRO issue

Tres Seaver tseaver at zope.com
Tue Nov 25 15:46:06 EST 2003


On Mon, 2003-11-24 at 12:03, Christian Heimes wrote:
> Sidnei da Silva wrote:
> > I'm going to fix those (after my english class) and then try something
> > harder ;)
> 
> Here is more stuff:
> 
>  >>> import mrohell
>  >>> base = mrohell.step1()
>  >>> mrohell.step2(base, mroonly=True)
> Couldn't get mro for  Products.Archetypes.BaseBTreeFolder.BaseBTreeFolder
> Couldn't get mro for  Products.Archetypes.BaseFolder.BaseFolder
> Couldn't get mro for 
> Products.Archetypes.OrderedBaseFolder.OrderedBaseFolder
> Couldn't get mro for 
> Products.GroupUserFolder.GroupUserFolder.GroupUserFolder
> Couldn't get mro for  Products.CMFPlone.PloneFolder.BasePloneFolder		
> Couldn't get mro for  Products.CMFPlone.LargePloneFolder.LargePloneFolder
> Couldn't get mro for  Products.Archetypes.BaseFolder.BaseFolderMixin
> Couldn't get mro for  Products.CMFDefault.SkinnedFolder.SkinnedFolder
> Couldn't get mro for  Products.CMFPlone.PloneFolder.PloneFolder
> Couldn't get mro for  Products.Archetypes.ArchetypeTool.ArchetypeTool
> Couldn't get mro for  Products.CMFFormController.Script.FSPythonScript
> Couldn't get mro for 
> Products.CMFFormController.FSControllerValidator.FSControllerValidator
> Couldn't get mro for  Products.CMFCore.FSPythonScript.FSPythonScript
> Couldn't get mro for 
> Products.CMFFormController.FSControllerPythonScript.FSControllerPythonScript
> Couldn't get mro for  Products.CMFCore.FSPageTemplate.FSPageTemplate
> Couldn't get mro for 
> Products.CMFFormController.FSControllerPageTemplate.FSControllerPageTemplate
> Couldn't get mro for  Products.CMFPlone.PropertiesTool.PropertiesTool
> Couldn't get mro for  Products.CMFCore.FSZSQLMethod.FSZSQLMethod
> Couldn't get mro for  Products.CMFPlone.FactoryTool.TempFolder
> Couldn't get mro for  Products.Archetypes.OrderedBaseFolder.OrderedFolder
> Couldn't get mro for  Products.Archetypes.examples.SimpleFolder.SimpleFolder
> 526 21 210
> 
> 
> It seems that there are only several classes that cause problems:
> Products.CMFDefault.SkinnedFolder.SkinnedFolder
> Products.Archetypes.BaseFolder.BaseFolder
> Products.CMFCore.FS*
> Products.Archetypes.BaseFolder.BaseFolderMixin
> 
> AFAIK most of the other classes with mro problems are just subclasses of 
> these classes above.

Jim made checkins to deal with the CMF-related MRO problems, on his
'mro-advanture-branch'::

=== CMF/CMFDefault/SkinnedFolder.py 1.15 => 1.15.6.1 ===
--- CMF/CMFDefault/SkinnedFolder.py:1.15        Sat Jun 28 12:31:21 2003
+++ CMF/CMFDefault/SkinnedFolder.py     Fri Oct 31 14:24:19 2003
@@ -61,8 +61,7 @@
 ,
 )
 
-
-class SkinnedFolder(CMFCatalogAware, PortalFolder):
+class SkinnedFolder(PortalFolder):
     """
     """
     meta_type = 'Skinned Folder'
@@ -70,6 +69,10 @@
     security = ClassSecurityInfo()
 
     manage_options = PortalFolder.manage_options
+
+    indexObject = CMFCatalogAware.indexObject
+    unindexObject = CMFCatalogAware.unindexObject
+    reindexObject = CMFCatalogAware.reindexObject
 
     def __call__(self):
         '''

=== CMF/CMFCore/FSObject.py 1.15 => 1.15.2.1 ===
--- CMF/CMFCore/FSObject.py:1.15        Fri Sep 12 20:46:40 2003
+++ CMF/CMFCore/FSObject.py     Fri Oct 31 14:24:18 2003
@@ -18,7 +18,7 @@
 from string import split
 from os import path, stat
 
-import Acquisition, Globals
+import Acquisition, Globals, ExtensionClass
 from AccessControl import ClassSecurityInfo
 from OFS.SimpleItem import Item
 from DateTime import DateTime
@@ -31,7 +31,7 @@
 
 from OFS.Cache import Cacheable
 
-class FSObject(Acquisition.Implicit, Item, Cacheable):
+class FSObject(Item, Cacheable, Acquisition.Implicit,
ExtensionClass.Base):
     """FSObject is a base class for all filesystem based look-alikes.
     
     Subclasses of this class mimic ZODB based objects like Image and




I imagine making similar small changes to Archetypes won't be hard.

Tres.
-- 
===============================================================
Tres Seaver                                tseaver at zope.com
Zope Corporation      "Zope Dealers"       http://www.zope.com




More information about the Zope-Dev mailing list