[CMF-checkins] CVS: CMF/CMFSetup - typeinfo.py:1.16
Yvo Schubbe
y.2004_ at wcm-solutions.de
Sun Nov 28 16:40:27 EST 2004
Update of /cvs-repository/CMF/CMFSetup
In directory cvs.zope.org:/tmp/cvs-serv4222/CMFSetup
Modified Files:
typeinfo.py
Log Message:
- replaced hardcoded 'typeClasses' by an IFAwareObjectManager based solution
=== CMF/CMFSetup/typeinfo.py 1.15 => 1.16 ===
--- CMF/CMFSetup/typeinfo.py:1.15 Wed Nov 10 08:12:20 2004
+++ CMF/CMFSetup/typeinfo.py Sun Nov 28 16:40:27 2004
@@ -18,6 +18,7 @@
from xml.dom.minidom import parseString as domParseString
from xml.sax import parseString
+import Products
from AccessControl import ClassSecurityInfo
from Acquisition import Implicit
from Globals import InitializeClass
@@ -25,7 +26,6 @@
from Products.CMFCore.TypesTool import FactoryTypeInformation
from Products.CMFCore.TypesTool import ScriptableTypeInformation
-from Products.CMFCore.TypesTool import typeClasses
from Products.CMFCore.utils import getToolByName
from actions import _extractActionNodes
@@ -69,10 +69,12 @@
for info in info_list:
- klass_info = [ x for x in typeClasses
- if x[ 'name' ] == info[ 'kind' ] ][ 0 ]
-
- type_info = klass_info[ 'class' ]( **info )
+ for mt_info in Products.meta_types:
+ if mt_info['name'] == info['kind']:
+ type_info = mt_info['instance'](**info)
+ break
+ else:
+ raise ValueError('unknown kind \'%s\'' % info['kind'])
types_tool._setObject( str( info[ 'id' ] ), type_info )
More information about the CMF-checkins
mailing list