[Zope-dev] RFC: product initialization cleanup and improvements

yuppie y.2005- at wcm-solutions.de
Tue Nov 1 07:19:14 EST 2005


Hi Dieter!


Dieter Maurer wrote:
> yuppie wrote at 2005-10-27 14:45 +0200:
>> ...
>> 1.) 'action' key:
>> -----------------
>>
>> I'd like to give empty 'action' values a special meaning: The meta_type 
>> is not visible in the add drop down in the ZMI.
>>
>> The five:registerClass directive allows to set empty 'action' values.
>>
>> This would resolve http://www.zope.org/Collectors/Zope/1885 .
>>
>> Filtering out meta_types with empty 'action' values is a two line change 
>> in main.dtml. I'd like to make that change also on the 2.8 branch to 
>> enable that feature for 2.8.5 with Five 1.2.
> 
> We already have the "visibility" key. Why do we need
> another (much obscurer) way to achieve the same thing?

Because it doesn't do the same thing. 'visibility' doesn't primarily 
change the visibility. It controls if the meta_type is globally 
available (visibility='Global') or only in containers that specify one 
of its interfaces (visibility=None).

>> ...
>> 4.) related cleanup:
>> --------------------
>>
>> Application.install_product has some backwards compatibility code for 
>> products that have initialization code outside the 'initialize' method 
>> of their __init__.py. This is deprecated at least for 5 years. I'd like 
>> to add explicit deprecation warnings on the 2.8 branch and to remove 
>> that code for Zope 2.9.
> 
> I hate that:
> 
>   While you might have the feeling that it were deprecated,
>   'ZSQLMethods' still use part of the old style initialization
>   (they have an "initialize" but still use "methods", "__ac_permissions__"
>   and "__module_aliases__").

Well. I think the comments in Application.install_product are very 
clear. 'initialize' was meant to replace the old way, not to provide a 
second way.

I fixed ZGadflyDA and ZSQLMethods.

>   And I occationally recommend these old style facilities.
> 
>   Having a warning period of 5 days (post on Oct 27; code freeze Nov 1)
>   seems very short.
> 
> What about removing the code for Zope 2.10?

If the change breaks too many existing products I'm fine with leaving 
the code including deprecation warnings in Zope 2.9.


Cheers,

	Yuppie




More information about the Zope-Dev mailing list