[CMF-checkins] CVS: CMF/CMFSetup - typeinfo.py:1.19 workflow.py:1.33

Yvo Schubbe y.2005- at wcm-solutions.de
Mon Jan 17 05:40:40 EST 2005


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

Modified Files:
	typeinfo.py workflow.py 
Log Message:
- fixed readDataFile calls for files in subdirs
- removed redundant _getWorkflowFilename in workflow.py


=== CMF/CMFSetup/typeinfo.py 1.18 => 1.19 ===
--- CMF/CMFSetup/typeinfo.py:1.18	Wed Jan 12 05:57:14 2005
+++ CMF/CMFSetup/typeinfo.py	Mon Jan 17 05:40:39 2005
@@ -59,7 +59,12 @@
 
     for type_info in tool_info[ 'types' ]:
 
-        text = context.readDataFile( type_info[ 'filename' ] )
+        filename = type_info[ 'filename' ]
+        sep = filename.rfind( '/' )
+        if sep == -1:
+            text = context.readDataFile( filename )
+        else:
+            text = context.readDataFile( filename[sep+1:], filename[:sep] )
         info = tic.parseXML( text )
 
         for mt_info in Products.meta_types:


=== CMF/CMFSetup/workflow.py 1.32 => 1.33 ===
--- CMF/CMFSetup/workflow.py:1.32	Tue Dec 14 15:56:57 2004
+++ CMF/CMFSetup/workflow.py	Mon Jan 17 05:40:39 2005
@@ -97,7 +97,13 @@
 
             if info[ 'meta_type' ] == DCWorkflowDefinition.meta_type:
 
-                wf_text = context.readDataFile( info[ 'filename' ] )
+                filename = info[ 'filename' ]
+                sep = filename.rfind( '/' )
+                if sep == -1:
+                    wf_text = context.readDataFile( filename )
+                else:
+                    wf_text = context.readDataFile( filename[sep+1:],
+                                                    filename[:sep] )
 
                 ( workflow_id
                 , title
@@ -793,7 +799,7 @@
 
 def _getWorkflowFilename( workflow_id ):
 
-    """ Return the name of the file which holds info for a given type.
+    """ Return the name of the file which holds info for a given workflow.
     """
     return 'workflows/%s/definition.xml' % workflow_id.replace( ' ', '_' )
 
@@ -1128,13 +1134,6 @@
 , ExternalMethod.meta_type : 'em'
 , DTMLMethod.meta_type : 'dtml'
 }
-
-def _getWorkflowFilename( wf_id ):
-
-    """ Return the name of the file which holds info for a given workflow.
-    """
-    return 'workflows/%s/definition.xml' % wf_id.replace( ' ', '_' )
-
 
 def _initDCWorkflow( workflow
                    , title



More information about the CMF-checkins mailing list