[CMF-checkins] CVS: CMF/CMFSetup - tool.py:1.4
Tres Seaver
tseaver at zope.com
Sun May 23 17:32:58 EDT 2004
Update of /cvs-repository/CMF/CMFSetup
In directory cvs.zope.org:/tmp/cvs-serv27554
Modified Files:
tool.py
Log Message:
- tool.py:
o Ensure that when running multiple steps (due to dependencies), all
run with the same context.
=== CMF/CMFSetup/tool.py 1.3 => 1.4 ===
--- CMF/CMFSetup/tool.py:1.3 Sun May 23 17:05:08 2004
+++ CMF/CMFSetup/tool.py Sun May 23 17:32:27 2004
@@ -111,6 +111,9 @@
""" See ISetupTool.
"""
+ profile_path = self._getFullyQualifiedProfileDirectory()
+ context = ImportContext( self, profile_path, purge_old )
+
info = self._import_registry.getStepMetadata( step_id )
if info is None:
@@ -123,15 +126,10 @@
for dependency in dependencies:
if already.get( dependency ) is None:
- self.runImportStep( dependency )
+ self._doRunImportStep( dependency, context )
already[ dependency ] = 1
- handler = self._import_registry.getStep( step_id )
-
- profile_path = self._getFullyQualifiedProfileDirectory()
- context = ImportContext( self, profile_path, purge_old )
-
- return handler( context )
+ return self._doRunImportStep( step_id, context )
security.declareProtected( ManagePortal, 'runAllSetupSteps')
def runAllImportSteps( self, purge_old=True ):
@@ -212,5 +210,14 @@
f.close()
self._export_registry.importFromXML( xml )
+
+ security.declarePrivate( '_doRunImportStep' )
+ def _doRunImportStep( self, step_id, context ):
+
+ """ Run a single import step, using a pre-built context.
+ """
+ handler = self._import_registry.getStep( step_id )
+
+ return handler( context )
InitializeClass( SetupTool )
More information about the CMF-checkins
mailing list