Re: [Zope-CMF] GenericSetup import and export step registries

2011-03-05 Thread Wichert Akkerman
On 3/5/11 09:47 , Vincent Fretin wrote:
> On Wed, Mar 2, 2011 at 3:13 PM, Godefroid Chapelle  > 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@zope.org
https://mail.zope.org/mailman/listinfo/zope-cmf

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


Re: [Zope-CMF] GenericSetup import and export step registries

2011-03-05 Thread Vincent Fretin
 On Wed, Mar 2, 2011 at 3:13 PM, Godefroid Chapelle 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
___
Zope-CMF maillist  -  Zope-CMF@zope.org
https://mail.zope.org/mailman/listinfo/zope-cmf

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


Re: [Zope-CMF] GenericSetup import and export step registries

2011-03-02 Thread Godefroid Chapelle
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@zope.org
https://mail.zope.org/mailman/listinfo/zope-cmf

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


Re: [Zope-CMF] GenericSetup import and export step registries

2011-03-02 Thread Godefroid Chapelle
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@zope.org
https://mail.zope.org/mailman/listinfo/zope-cmf

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


Re: [Zope-CMF] GenericSetup import and export step registries

2011-03-02 Thread Wichert Akkerman
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@zope.org
https://mail.zope.org/mailman/listinfo/zope-cmf

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


Re: [Zope-CMF] GenericSetup import and export step registries

2011-03-02 Thread Godefroid Chapelle
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@zope.org
https://mail.zope.org/mailman/listinfo/zope-cmf

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


Re: [Zope-CMF] GenericSetup import and export step registries

2011-03-02 Thread Wichert Akkerman
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@zope.org
https://mail.zope.org/mailman/listinfo/zope-cmf

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


[Zope-CMF] GenericSetup import and export step registries

2011-03-02 Thread Godefroid Chapelle
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@zope.org
https://mail.zope.org/mailman/listinfo/zope-cmf

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