[Checkins] SVN: GenericSetup/branches/wichert-zcml-steps/ Hook the
new export registry into the tool and update the ZMI pages to
use the new API
Wichert Akkerman
wichert at wiggy.net
Tue Oct 30 04:16:59 EDT 2007
Log message for revision 81200:
Hook the new export registry into the tool and update the ZMI pages to use the new API
Changed:
U GenericSetup/branches/wichert-zcml-steps/tool.py
U GenericSetup/branches/wichert-zcml-steps/www/sutExportSteps.zpt
U GenericSetup/branches/wichert-zcml-steps/www/sutImportSteps.zpt
-=-
Modified: GenericSetup/branches/wichert-zcml-steps/tool.py
===================================================================
--- GenericSetup/branches/wichert-zcml-steps/tool.py 2007-10-30 08:11:18 UTC (rev 81199)
+++ GenericSetup/branches/wichert-zcml-steps/tool.py 2007-10-30 08:16:59 UTC (rev 81200)
@@ -46,6 +46,7 @@
from registry import ToolsetRegistry
from registry import _profile_registry
from registry import _import_step_registry
+from registry import _export_step_registry
from upgrade import listUpgradeSteps
from upgrade import listProfilesWithUpgrades
@@ -250,6 +251,22 @@
return self._export_registry
+ security.declareProtected(ManagePortal, 'getExportStep')
+ def getExportStep(self, step, default=None):
+ """Simple wrapper to query both the global and local step registry."""
+ res=_export_step_registry.getStep(step, default)
+ if res is not default:
+ return res
+ return self._export_registry.getStep(step, default)
+
+
+ security.declareProtected(ManagePortal, 'listExportSteps')
+ def listExportSteps(self):
+ steps = _export_step_registry._registered.keys() + \
+ self._export_registry._registered.keys()
+ return steps
+
+
security.declareProtected(ManagePortal, 'getImportStep')
def getImportStep(self, step, default=None):
"""Simple wrapper to query both the global and local step registry."""
@@ -376,7 +393,7 @@
""" See ISetupTool.
"""
- return self._doRunExportSteps(self._export_registry.listSteps())
+ return self._doRunExportSteps(self.listExportSteps())
security.declareProtected(ManagePortal, 'createSnapshot')
def createSnapshot(self, snapshot_id):
@@ -385,7 +402,7 @@
"""
context = SnapshotExportContext(self, snapshot_id)
messages = {}
- steps = self._export_registry.listSteps()
+ steps = self.listExportSteps()
for step_id in steps:
Modified: GenericSetup/branches/wichert-zcml-steps/www/sutExportSteps.zpt
===================================================================
--- GenericSetup/branches/wichert-zcml-steps/www/sutExportSteps.zpt 2007-10-30 08:11:18 UTC (rev 81199)
+++ GenericSetup/branches/wichert-zcml-steps/www/sutExportSteps.zpt 2007-10-30 08:16:59 UTC (rev 81200)
@@ -25,12 +25,11 @@
</tr>
</thead>
- <tbody tal:define="registry here/getExportStepRegistry;
- step_ids registry/listSteps;
+ <tbody tal:define="step_ids here/listExportSteps;
">
<tal:loop tal:repeat="step_id step_ids">
<tr valign="top"
- tal:define="info python: registry.getStepMetadata( step_id );"
+ tal:define="info python: here.getExportStepMetadata( step_id );"
tal:attributes="class python:
repeat[ 'step_id' ].odd and 'row-normal' or 'row-hilite'" >
<td class="list-item" width="16">
Modified: GenericSetup/branches/wichert-zcml-steps/www/sutImportSteps.zpt
===================================================================
--- GenericSetup/branches/wichert-zcml-steps/www/sutImportSteps.zpt 2007-10-30 08:11:18 UTC (rev 81199)
+++ GenericSetup/branches/wichert-zcml-steps/www/sutImportSteps.zpt 2007-10-30 08:16:59 UTC (rev 81200)
@@ -55,12 +55,11 @@
</tr>
</thead>
- <tbody tal:define="registry context/getImportStepRegistry;
- step_ids registry/sortSteps;
+ <tbody tal:define="step_ids context/getSortedImportSteps;
">
<tal:loop tal:repeat="step_id step_ids">
<tr valign="top"
- tal:define="info python: registry.getStepMetadata( step_id );"
+ tal:define="info python: context.getImportStepMetadata( step_id );"
tal:attributes="class python:
repeat[ 'step_id' ].odd and 'row-normal' or 'row-hilite';
style python:info['invalid'] and 'background: red' or None" >
More information about the Checkins
mailing list