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

Mikko Ohtamaa mikko+plone at redinnovation.com
Fri Jan 3 08:34:42 UTC 2014


Not perfect, but better definitely more Pythonic than ZCML!

-M


On 3 January 2014 10:17, Asko Soukka <asko.soukka at iki.fi> wrote:

> Hi,
>
> last year there was (again) a long discussion about pros and cons of
> grok-based configuration:
>
> http://plone.293351.n2.nabble.com/GROK-RULES-I-WANT-IT-MORE-
> Was-The-grokless-madness-and-unable-to-create-a-simple-form-tt7564217.html
>
> TL;DR; It seems that Grok will never have feature parity with ZCML, but it
> has use cases and we have nothing to replace it.
>
>
> I've been experimenting with an alternative lately: a venusian-based
> configuration library for zope.configuration; All python, minimal
> dependencies, uses the same directive code as ZCML (= feature parity), no
> conventions - just IDE-friendly Python-based configuration.
>
> I'm not forcing this to anyone. An another way to configure may be the
> last thing we need. Yet, I want to try this approach as a grok-replacement
> for our (my employer) internal packages during this spring (we'll have new
> developers and grok has always been easier to teach than ZCML). Only for
> add-on-packages.
>
> So, before spending too much time polishing the code, I'd like to request
> for your comments about the configuration syntax, which I've been tinkering:
>
> https://github.com/datakurre/collective.venusianconfig/
> blob/master/demo/src/venusianconfigdemo/configure.py
>
> https://github.com/datakurre/collective.venusianconfig/
> blob/master/demo/src/venusianconfigdemo/views.py
>
> https://github.com/datakurre/collective.venusianconfig/
> blob/master/demo/src/venusianconfigdemo/adapters.py
>
> https://github.com/datakurre/collective.venusianconfig/
> blob/master/demo/src/venusianconfigdemo/portlets/configure.py
>
>
> So, it's not grok. It's a Python-syntax for zope.configuration with
> optional support for limited set of decorators (directives with class,
> factory or handler).
>
> Venusian-library is used to make all configuration directives lazy:
> venusian creates "registration callbacks" during module import, but those
> callbacks are only executed when packages is imported by zope.configuration.
>
>
> The current catch is that this needs one line in zope.conf (for
> monkeypatching zope.configuration) and custom site.zcml (for
> z3c.autoinclude also Python-configured packages). These are required to
> work around hardcoded zcml-expectations.
>
>
> Waiting for your comments.
>
> Regards,
> Asko
> _______________________________________________
> Product-Developers mailing list
> Product-Developers at lists.plone.org
> https://lists.plone.org/mailman/listinfo/plone-product-developers
>



-- 
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/20140103/d1ec2182/attachment.html>


More information about the Product-Developers mailing list