[CMF-checkins]
SVN: CMF/branches/tseaver-pkg_resources/CMFCore/utils.py
Remove ZClass support;
use non-private interface for EggProductContext.
Tres Seaver
tseaver at palladion.com
Thu Nov 10 17:13:28 EST 2005
Log message for revision 40044:
Remove ZClass support; use non-private interface for EggProductContext.
Changed:
U CMF/branches/tseaver-pkg_resources/CMFCore/utils.py
-=-
Modified: CMF/branches/tseaver-pkg_resources/CMFCore/utils.py
===================================================================
--- CMF/branches/tseaver-pkg_resources/CMFCore/utils.py 2005-11-10 22:12:38 UTC (rev 40043)
+++ CMF/branches/tseaver-pkg_resources/CMFCore/utils.py 2005-11-10 22:13:28 UTC (rev 40044)
@@ -554,7 +554,11 @@
def initialize(self, context):
# Add only one meta type to the folder add list.
- productObject = context._ProductContext__prod
+ try:
+ productObject = context._ProductContext__prod
+ except AttributeError:
+ productObject = context.product
+
self.product_name = productObject.id
context.registerClass(
meta_type = self.meta_type,
@@ -690,38 +694,6 @@
if REQUEST is not None:
return self.manage_main(self, REQUEST)
-
-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.
- """
- rval = []
- for base_class in base_classes:
- d={}
- zclass_name = '_ZClass_for_%s' % base_class.__name__
- exec 'class %s: pass' % zclass_name in d
- Z = d[ zclass_name ]
- Z.propertysheets = PropertySheets()
- Z._zclass_ = base_class
- Z.manage_options = ()
- Z.__module__ = module.__name__
- setattr( module, zclass_name, Z )
- rval.append(Z)
- return rval
-
-def initializeBasesPhase2(zclasses, context):
-
- """ Finishes ZClass base initialization.
-
- o 'zclasses' is the list returned by initializeBasesPhase1().
-
- o 'context' is a ProductContext object.
- """
- for zclass in zclasses:
- context.registerZClass(zclass)
-
def registerIcon(klass, iconspec, _prefix=None):
""" Make an icon available for a given class.
More information about the CMF-checkins
mailing list