[Zope-CMF] GenericSetup import and export step registries

Godefroid Chapelle gotcha at bubblenet.be
Wed Mar 2 08:59:20 EST 2011


Hi,

I have been looking at GenericSetup tool.py.

The order in which global and local registries are queried is different 
in getImportStep and getExportStep on one side and in 
getImportStepMetadata and getExportStepMetadata on the other side.

See below:

    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)

    def getExportStepMetadata(self, step, default=None):
         """Simple wrapper to query both the global and local step 
registry."""
         res=self._export_registry.getStepMetadata(step, default)
         if res is not default:
             return res
         return _export_step_registry.getStepMetadata(step, default)

I have looked at the SVN history and it seems that there has been 
merging problems.

In line with usual ZCA pattern which queries local before global, I 
guess that the local registry should be queried before the global like 
in getImportStepMetadata and getExportStepMetadata.

IOW, it seems it should be :

    def getExportStep(self, step, default=None):
         """Simple wrapper to query both the global and local step 
registry."""
         res=self._export_step_registry.getStep(step, default)
         if res is not default:
             return res
         return _export_registry.getStep(step, default)

    def getExportStepMetadata(self, step, default=None):
         """Simple wrapper to query both the global and local step 
registry."""
         res=self._export_registry.getStepMetadata(step, default)
         if res is not default:
             return res
         return _export_step_registry.getStepMetadata(step, default)


Can someone confirm ?

-- 
Godefroid Chapelle (aka __gotcha) http://bubblenet.be



More information about the Zope-CMF mailing list