[CMF-checkins] CVS: CMF/CMFSetup - context.py:1.8 typeinfo.py:1.6

Tres Seaver tseaver at zope.com
Sun May 30 16:30:21 EDT 2004


Update of /cvs-repository/CMF/CMFSetup
In directory cvs.zope.org:/tmp/cvs-serv18926

Modified Files:
	context.py typeinfo.py 
Log Message:


  - context.py:

    o Ensure that archive members have current mtime.

  - typeinfo.py:

    o Force lookup of portal_types.getTypeInfo() to use a string key
      (the method fails if passed a Unicode equivalent!)


=== CMF/CMFSetup/context.py 1.7 => 1.8 ===
--- CMF/CMFSetup/context.py:1.7	Tue May 25 08:48:53 2004
+++ CMF/CMFSetup/context.py	Sun May 30 16:29:50 2004
@@ -202,6 +202,7 @@
         stream = StringIO( text )
         info = TarInfo( filename )
         info.size = len( text )
+        info.mtime = time.time()
         self._archive.addfile( info, stream )
 
     security.declareProtected( ManagePortal, 'getArchive' )


=== CMF/CMFSetup/typeinfo.py 1.5 => 1.6 ===
--- CMF/CMFSetup/typeinfo.py:1.5	Sun May 30 16:00:55 2004
+++ CMF/CMFSetup/typeinfo.py	Sun May 30 16:29:50 2004
@@ -96,7 +96,7 @@
         """
         typestool = getToolByName( self._site, 'portal_types' )
         try:
-            ti = typestool.getTypeInfo( type_id )
+            ti = typestool.getTypeInfo( str( type_id ) ) # gTI expects ASCII?
         except KeyError:
             raise ValueError, 'Unknown type: %s' % type_id
         else:
@@ -114,10 +114,10 @@
         result = []
         typestool = getToolByName( self._site, 'portal_types' )
 
-        ids = typestool.listContentTypes()
+        type_ids = typestool.listContentTypes()
 
-        for id in ids:
-            mapping = self._makeTIMapping( typestool.getTypeInfo( id ) )
+        for type_id in type_ids:
+            mapping = self.getTypeInfo( type_id )
             result.append( mapping )
 
         return result




More information about the CMF-checkins mailing list