[CMF-checkins] CVS: CMF/CMFSetup - context.py:1.2 interfaces.py:1.5
tool.py:1.3
Tres Seaver
tseaver at zope.com
Sun May 23 17:05:39 EDT 2004
Update of /cvs-repository/CMF/CMFSetup
In directory cvs.zope.org:/tmp/cvs-serv21820
Modified Files:
context.py interfaces.py tool.py
Log Message:
- context.py:
o Repair lamosity.
- interfaces.py:
o Finish rename from 'setupStep' to 'importStep'.
- tool.py:
o Implement and test 'runImportStep'.
=== CMF/CMFSetup/context.py 1.1 => 1.2 ===
--- CMF/CMFSetup/context.py:1.1 Fri May 21 17:12:39 2004
+++ CMF/CMFSetup/context.py Sun May 23 17:05:08 2004
@@ -29,7 +29,7 @@
self._should_purge = bool( should_purge )
security.declareProtected( ManagePortal, 'getSite' )
- def getSite():
+ def getSite( self ):
""" See ISetupContext.
"""
@@ -113,7 +113,7 @@
self._profile_path = profile_path
security.declareProtected( ManagePortal, 'getSite' )
- def getSite():
+ def getSite( self ):
""" See ISetupContext.
"""
=== CMF/CMFSetup/interfaces.py 1.4 => 1.5 ===
--- CMF/CMFSetup/interfaces.py:1.4 Sun May 23 16:31:43 2004
+++ CMF/CMFSetup/interfaces.py Sun May 23 17:05:08 2004
@@ -289,7 +289,7 @@
""" Return the IExportStepRegistry for the tool.
"""
- def runSetupStep( step_id, purge_old=True, run_dependencies=True ):
+ def runImportStep( step_id, purge_old=True, run_dependencies=True ):
""" Execute a given setup step
@@ -303,7 +303,7 @@
dependency steps first.
"""
- def runAllSetupSteps( purge_old=True ):
+ def runAllImportSteps( purge_old=True ):
""" Run all setup steps in dependency order.
=== CMF/CMFSetup/tool.py 1.2 => 1.3 ===
--- CMF/CMFSetup/tool.py:1.2 Sun May 23 16:31:43 2004
+++ CMF/CMFSetup/tool.py Sun May 23 17:05:08 2004
@@ -12,6 +12,8 @@
from interfaces import ISetupTool
from permissions import ManagePortal
+from context import ImportContext
+from context import ExportContext
from registry import ImportStepRegistry
from registry import ExportStepRegistry
@@ -105,13 +107,34 @@
return self._export_registry
security.declareProtected( ManagePortal, 'executeStep' )
- def runSetupStep( self, step_id, run_dependencies=True, purge_old=True ):
+ def runImportStep( self, step_id, run_dependencies=True, purge_old=True ):
""" See ISetupTool.
"""
+ info = self._import_registry.getStepMetadata( step_id )
+
+ if info is None:
+ raise ValueError, 'No such import step: %s' % step_id
+
+ dependencies = info.get( 'dependencies', () )
+
+ if run_dependencies:
+ already = {}
+ for dependency in dependencies:
+
+ if already.get( dependency ) is None:
+ self.runImportStep( dependency )
+ already[ dependency ] = 1
+
+ handler = self._import_registry.getStep( step_id )
+
+ profile_path = self._getFullyQualifiedProfileDirectory()
+ context = ImportContext( self, profile_path, purge_old )
+
+ return handler( context )
security.declareProtected( ManagePortal, 'runAllSetupSteps')
- def runAllSetupSteps( self, purge_old=True ):
+ def runAllImportSteps( self, purge_old=True ):
""" See ISetupTool.
"""
More information about the CMF-checkins
mailing list