Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Zope: CMF

GenericSetup import and export step registries

 

 

Zope cmf RSS feed   Index | Next | Previous | View Threaded


gotcha at bubblenet

Mar 2, 2011, 5:59 AM

Post #1 of 8 (862 views)
Permalink
GenericSetup import and export step registries

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

_______________________________________________
Zope-CMF maillist - Zope-CMF [at] zope
https://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests


wichert at wiggy

Mar 2, 2011, 6:01 AM

Post #2 of 8 (857 views)
Permalink
Re: GenericSetup import and export step registries [In reply to]

On 3/2/11 14:59 , Godefroid Chapelle wrote:
> 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.

How about we just get rid of the local step registration completely?

Wichert.
_______________________________________________
Zope-CMF maillist - Zope-CMF [at] zope
https://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests


gotcha at bubblenet

Mar 2, 2011, 6:01 AM

Post #3 of 8 (852 views)
Permalink
Re: GenericSetup import and export step registries [In reply to]

Le 02/03/11 14:59, Godefroid Chapelle a écrit :
> 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)

I meant :

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


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

_______________________________________________
Zope-CMF maillist - Zope-CMF [at] zope
https://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests


gotcha at bubblenet

Mar 2, 2011, 6:03 AM

Post #4 of 8 (852 views)
Permalink
Re: GenericSetup import and export step registries [In reply to]

Le 02/03/11 15:01, Wichert Akkerman a écrit :
> On 3/2/11 14:59 , Godefroid Chapelle wrote:
>> 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.
>
> How about we just get rid of the local step registration completely?
>
> Wichert.

That question was on my lips. I do not understand which use cases are
covered by those local registries.

--
Godefroid Chapelle (aka __gotcha) http://bubblenet.be
_______________________________________________
Zope-CMF maillist - Zope-CMF [at] zope
https://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests


wichert at wiggy

Mar 2, 2011, 6:04 AM

Post #5 of 8 (849 views)
Permalink
Re: GenericSetup import and export step registries [In reply to]

On 3/2/11 15:03 , Godefroid Chapelle wrote:
> Le 02/03/11 15:01, Wichert Akkerman a écrit :
>> On 3/2/11 14:59 , Godefroid Chapelle wrote:
>>> 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.
>>
>> How about we just get rid of the local step registration completely?
>>
>> Wichert.
>
> That question was on my lips. I do not understand which use cases are
> covered by those local registries.

None. The initial implementation only had local registries, but their
behaviour was inconsistent and confusing so we added the global
registration as a better alternative.

Wichert.
_______________________________________________
Zope-CMF maillist - Zope-CMF [at] zope
https://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests


gotcha at bubblenet

Mar 2, 2011, 6:13 AM

Post #6 of 8 (854 views)
Permalink
Re: GenericSetup import and export step registries [In reply to]

Le 02/03/11 15:04, Wichert Akkerman a écrit :
> None. The initial implementation only had local registries, but their
> behaviour was inconsistent and confusing so we added the global
> registration as a better alternative.
>
> Wichert.

Can we just get rid of those local registries ?
I guess some migration code would be needed.

If we want to avoid migration, we could raise an exception if we find
any import_steps.xml or export_steps.xml files.

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

_______________________________________________
Zope-CMF maillist - Zope-CMF [at] zope
https://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests


vincent.fretin at gmail

Mar 5, 2011, 12:47 AM

Post #7 of 8 (816 views)
Permalink
Re: GenericSetup import and export step registries [In reply to]

On Wed, Mar 2, 2011 at 3:13 PM, Godefroid Chapelle <gotcha [at] bubblenet>wrote:

> Le 02/03/11 15:04, Wichert Akkerman a écrit :
> > None. The initial implementation only had local registries, but their
> > behaviour was inconsistent and confusing so we added the global
> > registration as a better alternative.
> >
> > Wichert.
>
> Can we just get rid of those local registries ?
> I guess some migration code would be needed.
>
> If we want to avoid migration, we could raise an exception if we find
> any import_steps.xml or export_steps.xml files.
>

ArchGenXML still generates a import_steps.xml file to register various
steps.
If you remove local registries, I won't be able to use newer GenericSetup
version (so newer Plone 4.0.x and 4.1)
for my current project unless I take the time to modify archgenxml to
generate imports steps registered with zcml,
and document the upgrade procedure.

Vincent Fretin


wichert at wiggy

Mar 5, 2011, 3:01 AM

Post #8 of 8 (808 views)
Permalink
Re: GenericSetup import and export step registries [In reply to]

On 3/5/11 09:47 , Vincent Fretin wrote:
> On Wed, Mar 2, 2011 at 3:13 PM, Godefroid Chapelle <gotcha [at] bubblenet
> <mailto:gotcha [at] bubblenet>> wrote:
>
> Le 02/03/11 15:04, Wichert Akkerman a écrit :
> > None. The initial implementation only had local registries, but their
> > behaviour was inconsistent and confusing so we added the global
> > registration as a better alternative.
> >
> > Wichert.
>
> Can we just get rid of those local registries ?
> I guess some migration code would be needed.
>
> If we want to avoid migration, we could raise an exception if we find
> any import_steps.xml or export_steps.xml files.
>
>
> ArchGenXML still generates a import_steps.xml file to register various
> steps.

I'ld say that is a bug in ArchGenXML - import_steps.xml has been
(perhaps unofficially, I forgot if we added warnings) deprecated for a
long time now.

Wichert.
_______________________________________________
Zope-CMF maillist - Zope-CMF [at] zope
https://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests

Zope cmf RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.