[CMF-checkins] CVS: CMF/CMFSetup - typeinfo.py:1.7
Tres Seaver
tseaver at zope.com
Tue Jun 8 15:00:59 EDT 2004
Update of /cvs-repository/CMF/CMFSetup
In directory cvs.zope.org:/tmp/cvs-serv24092
Modified Files:
typeinfo.py
Log Message:
- Ensure that 'parse*XML' steps return data structures, rather than side effects.
=== CMF/CMFSetup/typeinfo.py 1.6 => 1.7 ===
--- CMF/CMFSetup/typeinfo.py:1.6 Sun May 30 16:29:50 2004
+++ CMF/CMFSetup/typeinfo.py Tue Jun 8 15:00:28 2004
@@ -45,7 +45,16 @@
for type_id, type_filename in configurator.parseToolXML( text ):
text = context.readDataFile( type_filename )
- configurator.parseTypeXML( text )
+ info_list = configurator.parseTypeXML( text )
+
+ for info in info_list:
+
+ klass_info = [ x for x in typeClasses
+ if x[ 'name' ] == info[ 'kind' ] ][ 0 ]
+
+ type_info = klass_info[ 'class' ]( **info )
+
+ types_tool._setObject( str( info[ 'id' ] ), type_info )
# XXX: YAGNI?
@@ -154,14 +163,7 @@
parser = _TypeInfoParser( encoding )
parseString( xml, parser )
- for info in parser._info_list:
-
- klass_info = [ x for x in typeClasses
- if x[ 'name' ] == info[ 'kind' ] ][ 0 ]
-
- type_info = klass_info[ 'class' ]( **info )
-
- tool._setObject( str( info[ 'id' ] ), type_info )
+ return parser._info_list
#
# Helper methods
More information about the CMF-checkins
mailing list