[Product-Developers] RFC: Venusian-based Python-syntax alternative for ZCML-configuration

Mikko Ohtamaa mikko+plone at redinnovation.com
Mon Jan 6 13:43:29 UTC 2014


Hi,

You might be right regarding configure() - unnecessary complexity.

Also about imports: as long as we promote best practices the system not to
make (unnecessary) crash on the import phase and have solutions to tackle
around those conflicting configuration problems it should be ok. I trust
Asko's judgement that he knows what he is doing, as he must have suffered
from ZCML, Grok, etc. issues in the past too :)

-Mikko


On 6 January 2014 15:35, Asko Soukka <asko.soukka at iki.fi> wrote:

> Hi Mikko,
>
> thanks for taking part :)
>
> Mikko Ohtamaa wrote:
>
>> Python can make things pretty for you.
>>
>> with has_package("plone.app.z3cform", version=">1.3.0"):
>>        # do something
>>
>
> That's very nice.
>
>
>  Also all scans should be explicit, preferably not executed on the module
>> body level. If you put things to a function e.g.
>>
>
> All scans must already be explicit, and currently recursive scans are not
> supported, so each module must be scanned separately. I like it very
> exlicit, so I'm not sure, should I hurry support for recursive scan.
>
>
>  def configurare():
>>        ... configure my package...
>>
>> And then those configure()s are executed in well-known order, the
>> package author has more leverage and tools in the possession to tackle
>> potential conflict issues (E.g. as the last resolt monkey-patch another
>> configure())
>>
>
> Currently importing module does not execute anything, but just registers
> venusian callbacks for zope.configuration calls and venusian scans (which
> would execute more zope configuration calls). Registered venusian callbacks
> only executed when package is included in zope.configuration.
>
> This makes execution order very explicit. All zope.configuration rules do
> apply, so configuration for the other monkeypatching package could be
> included before own package.
>
> So, while I've been thinking about def configure(), I'm not sure if it's
> necessary. It would add one more thing to know (and different from zcml)
> and one more indentation level for configuration file.
>
> Also, it starts looking weird, when one has configure.py:
>
> def configure():
>     from collective.venusianconfig import configure
>
>     configure.gs.registerProfile(...)
>
> ("configure" configuration class is currently named after the zcml root
> tag "configure")
>
> Regards,
> Asko
>



-- 
Mikko Ohtamaa
http://opensourcehacker.com
http://twitter.com/moo9000
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.plone.org/pipermail/plone-product-developers/attachments/20140106/60a7aa86/attachment.html>


More information about the Product-Developers mailing list