[CMF-checkins] SVN: CMF/trunk/C - removed ZClasses support

Yvo Schubbe y.2006_ at wcm-solutions.de
Fri Jun 2 06:27:33 EDT 2006


Log message for revision 68456:
  - removed ZClasses support

Changed:
  U   CMF/trunk/CHANGES.txt
  U   CMF/trunk/CMFCalendar/__init__.py
  U   CMF/trunk/CMFCore/__init__.py
  U   CMF/trunk/CMFCore/utils.py
  U   CMF/trunk/CMFDefault/__init__.py
  U   CMF/trunk/CMFTopic/__init__.py
  U   CMF/trunk/CMFUid/__init__.py

-=-
Modified: CMF/trunk/CHANGES.txt
===================================================================
--- CMF/trunk/CHANGES.txt	2006-06-02 09:25:35 UTC (rev 68455)
+++ CMF/trunk/CHANGES.txt	2006-06-02 10:27:32 UTC (rev 68456)
@@ -15,6 +15,9 @@
 
   Others
 
+    - ZClasses: Removed unmaintained support for ZClasses.
+      Marked the 'initializeBases*' methods as deprecated. 
+
     - Content: All content classes are now registered by ZCML.
       ContentInit is still used to register oldstyle constructors.
 

Modified: CMF/trunk/CMFCalendar/__init__.py
===================================================================
--- CMF/trunk/CMFCalendar/__init__.py	2006-06-02 09:25:35 UTC (rev 68455)
+++ CMF/trunk/CMFCalendar/__init__.py	2006-06-02 10:27:32 UTC (rev 68456)
@@ -15,8 +15,6 @@
 $Id$
 """
 
-import sys
-
 import utils
 from Products.CMFCore import utils
 from Products.CMFCore.interfaces import ISiteRoot
@@ -29,24 +27,17 @@
 from permissions import AddPortalContent
 
 
-this_module = sys.modules[ __name__ ]
-
 contentConstructors = (Event.addEvent,)
-contentClasses = (Event.Event,)
-
 tools = ( CalendarTool.CalendarTool, )
 
-z_bases = utils.initializeBasesPhase1( contentClasses, this_module )
-
 # Make the skins available as DirectoryViews
 registerDirectory('skins', globals())
 
-def initialize( context ):
+def initialize(context):
+
     utils.ToolInit('CMF Calendar Tool', tools=tools, icon='tool.gif',
                    ).initialize( context )
 
-    utils.initializeBasesPhase2( z_bases, context )
-
     # BBB: register oldstyle constructors
     utils.ContentInit( 'CMF Calendar Content'
                      , content_types=()

Modified: CMF/trunk/CMFCore/__init__.py
===================================================================
--- CMF/trunk/CMFCore/__init__.py	2006-06-02 09:25:35 UTC (rev 68455)
+++ CMF/trunk/CMFCore/__init__.py	2006-06-02 10:27:32 UTC (rev 68456)
@@ -15,16 +15,14 @@
 $Id$
 """
 
-from sys import modules
-
-import PortalObject, PortalContent, PortalFolder
+import PortalFolder
 import MembershipTool, WorkflowTool, CatalogTool, DiscussionTool
 import ActionsTool, UndoTool, RegistrationTool, SkinsTool
 import MemberDataTool, TypesTool
 import URLTool
 import fiveactionstool
 import DirectoryView, FSImage, FSFile, FSPropertiesObject
-import FSDTMLMethod, FSPythonScript, FSSTXMethod
+import FSDTMLMethod, FSPythonScript
 import FSPageTemplate
 import FSZSQLMethod
 import ActionInformation
@@ -33,15 +31,13 @@
 import CachingPolicyManager
 import CMFBTreeFolder
 import utils
-
 from permissions import AddPortalFolders
 
 
-bases = (
-    PortalObject.PortalObjectBase,
-    PortalFolder.PortalFolder,
-    PortalContent.PortalContent,
-    )
+# Make sure security is initialized
+import FSSTXMethod
+import PortalContent
+import PortalObject
 
 tools = (
     MembershipTool.MembershipTool,
@@ -58,13 +54,6 @@
     fiveactionstool.FiveActionsTool,
     )
 
-this_module = modules[ __name__ ]
-
-z_bases = utils.initializeBasesPhase1(bases, this_module)
-z_tool_bases = utils.initializeBasesPhase1(tools, this_module)
-
-cmfcore_globals=globals()
-
 # BBB: oldstyle constructors
 _EXTRA_CONSTRUCTORS = (PortalFolder.manage_addPortalFolder,
                        CMFBTreeFolder.manage_addCMFBTreeFolder)
@@ -80,9 +69,6 @@
 
 def initialize(context):
 
-    utils.initializeBasesPhase2(z_bases, context)
-    utils.initializeBasesPhase2(z_tool_bases, context)
-
     context.registerClass(
         DirectoryView.DirectoryView,
         constructors=(('manage_addDirectoryViewForm',

Modified: CMF/trunk/CMFCore/utils.py
===================================================================
--- CMF/trunk/CMFCore/utils.py	2006-06-02 09:25:35 UTC (rev 68455)
+++ CMF/trunk/CMFCore/utils.py	2006-06-02 10:27:32 UTC (rev 68456)
@@ -15,10 +15,11 @@
 $Id$
 """
 
+import re
+from copy import deepcopy
 from os import path as os_path
 from os.path import abspath
-import re
-from copy import deepcopy
+from warnings import warn
 
 from AccessControl import ClassSecurityInfo
 from AccessControl import getSecurityManager
@@ -49,7 +50,6 @@
 
 from exceptions import AccessControl_Unauthorized
 from exceptions import NotFound
-from warnings import warn
 
 
 security = ModuleSecurityInfo( 'Products.CMFCore.utils' )
@@ -606,11 +606,14 @@
 
 
 def initializeBasesPhase1(base_classes, module):
-
     """ Execute the first part of initialization of ZClass base classes.
 
     Stuffs a _ZClass_for_x class in the module for each base.
     """
+    warn('initializeBasesPhase1() is deprecated and will be removed in CMF '
+         '2.3. There is no replacement because ZClasses are also deprecated.',
+         DeprecationWarning, stacklevel=2)
+
     rval = []
     for base_class in base_classes:
         d={}
@@ -626,13 +629,16 @@
     return rval
 
 def initializeBasesPhase2(zclasses, context):
-
     """ Finishes ZClass base initialization.
 
     o 'zclasses' is the list returned by initializeBasesPhase1().
 
     o 'context' is a ProductContext object.
     """
+    warn('initializeBasesPhase2() is deprecated and will be removed in CMF '
+         '2.3. There is no replacement because ZClasses are also deprecated.',
+         DeprecationWarning, stacklevel=2)
+
     for zclass in zclasses:
         context.registerZClass(zclass)
 
@@ -772,7 +778,6 @@
     RESPONSE.setHeader('Last-Modified', rfc1123_date(last_mod))
 
 
-
 class SimpleRecord:
     """ record-like class """
 

Modified: CMF/trunk/CMFDefault/__init__.py
===================================================================
--- CMF/trunk/CMFDefault/__init__.py	2006-06-02 09:25:35 UTC (rev 68455)
+++ CMF/trunk/CMFDefault/__init__.py	2006-06-02 10:27:32 UTC (rev 68456)
@@ -15,12 +15,8 @@
 $Id$
 """
 
-import sys
-
 from Products.CMFCore.DirectoryView import registerDirectory
 from Products.CMFCore.interfaces import ISiteRoot
-from Products.CMFCore.utils import initializeBasesPhase1
-from Products.CMFCore.utils import initializeBasesPhase2
 from Products.CMFCore.utils import ToolInit
 from Products.CMFCore.utils import ContentInit
 from Products.CMFCore.utils import registerIcon
@@ -28,38 +24,30 @@
 from Products.GenericSetup import EXTENSION
 from Products.GenericSetup import profile_registry
 
-import factory
-import utils
-from permissions import AddPortalContent
-
-import Portal
+import DefaultWorkflow
+import DiscussionTool
 import Document
-import Link
-import NewsItem
+import factory
+import Favorite
 import File
 import Image
-import Favorite
-import SkinnedFolder
-
-import DiscussionItem
-import PropertiesTool
+import Link
 import MembershipTool
 import MetadataTool
+import NewsItem
+import Portal
+import PropertiesTool
 import RegistrationTool
-import DublinCore
-import DiscussionTool
+import SkinnedFolder
 import SyndicationTool
-import DefaultWorkflow
+from permissions import AddPortalContent
 
-contentClasses = ( Document.Document
-                 , File.File
-                 , Image.Image
-                 , Link.Link
-                 , Favorite.Favorite
-                 , NewsItem.NewsItem
-                 , SkinnedFolder.SkinnedFolder
-                 )
 
+# Make sure security is initialized
+import DiscussionItem
+import DublinCore
+import utils
+
 contentConstructors = ( Document.addDocument
                       , File.addFile
                       , Image.addImage
@@ -69,13 +57,6 @@
                       , SkinnedFolder.addSkinnedFolder
                       )
 
-bases = ( ( Portal.CMFSite
-          , DublinCore.DefaultDublinCoreImpl
-          , DiscussionItem.DiscussionItem
-          )
-          + contentClasses
-        )
-
 tools = ( DiscussionTool.DiscussionTool
         , MembershipTool.MembershipTool
         , RegistrationTool.RegistrationTool
@@ -84,20 +65,12 @@
         , SyndicationTool.SyndicationTool
         )
 
-this_module = sys.modules[ __name__ ]
-
-z_bases = initializeBasesPhase1( bases, this_module )
-z_tool_bases = initializeBasesPhase1( tools, this_module )
-
 # Make the skins available as DirectoryViews.
 registerDirectory('skins', globals())
 registerDirectory('help', globals())
 
-def initialize( context ):
+def initialize(context):
 
-    initializeBasesPhase2( z_bases, context )
-    initializeBasesPhase2( z_tool_bases, context )
-
     ToolInit( 'CMF Default Tool'
             , tools=tools
             , icon='tool.gif'

Modified: CMF/trunk/CMFTopic/__init__.py
===================================================================
--- CMF/trunk/CMFTopic/__init__.py	2006-06-02 09:25:35 UTC (rev 68455)
+++ CMF/trunk/CMFTopic/__init__.py	2006-06-02 10:27:32 UTC (rev 68456)
@@ -15,10 +15,6 @@
 $Id$
 """
 
-import sys
-
-from ZClasses import createZClassForBase
-
 from Products.CMFCore.interfaces import ISiteRoot
 from Products.CMFCore.utils import ContentInit
 from Products.CMFCore.DirectoryView import registerDirectory
@@ -26,25 +22,20 @@
 from Products.GenericSetup import profile_registry
 
 import Topic
-import SimpleStringCriterion
-import SimpleIntCriterion
-import ListCriterion
-import DateCriteria
-import SortCriterion
 from permissions import AddTopics
 
 
-bases = ( Topic.Topic, )
+# Make sure security is initialized
+import DateCriteria
+import ListCriterion
+import SimpleIntCriterion
+import SimpleStringCriterion
+import SortCriterion
 
-this_module = sys.modules[ __name__ ]
-
-for base in bases:
-    createZClassForBase( base, this_module )
-
 # Make the skins available as DirectoryViews
 registerDirectory( 'skins', globals() )
 
-def initialize( context ):
+def initialize(context):
 
     context.registerHelpTitle( 'CMF Topic Help' )
     context.registerHelp( directory='help' )

Modified: CMF/trunk/CMFUid/__init__.py
===================================================================
--- CMF/trunk/CMFUid/__init__.py	2006-06-02 09:25:35 UTC (rev 68455)
+++ CMF/trunk/CMFUid/__init__.py	2006-06-02 10:27:32 UTC (rev 68456)
@@ -15,8 +15,6 @@
 $Id$
 """
 
-from sys import modules
-
 from Products.CMFCore import utils
 from Products.CMFCore.interfaces import ISiteRoot
 from Products.GenericSetup import EXTENSION
@@ -26,22 +24,15 @@
 import UniqueIdGeneratorTool
 import UniqueIdHandlerTool
 
+
 tools = (
     UniqueIdAnnotationTool.UniqueIdAnnotationTool,
     UniqueIdGeneratorTool.UniqueIdGeneratorTool,
     UniqueIdHandlerTool.UniqueIdHandlerTool,
 )
 
-this_module = modules[ __name__ ]
-
-z_tool_bases = utils.initializeBasesPhase1(tools, this_module)
-
-my_globals=globals()
-
 def initialize(context):
 
-    utils.initializeBasesPhase2(z_tool_bases, context)
-
     utils.ToolInit( 'CMF Unique Id Tool'
                   , tools=tools
                   , icon='tool.gif'



More information about the CMF-checkins mailing list