Re: Could it be possible to support configuring with *.cfg instead of *.zcml?

Robert Niederreiter <rnix-vzgNpXZZ1Rwgm7i/[email protected]>
Newsgroups gmane.comp.web.zope.plone.devel
Message-ID <[email protected]>
Am 24.11.2013 12:58, schrieb Asko Soukka:
> Hi Robert,
>
> Thanks for your comments.
>
> Robert Niederreiter wrote:
>> Nested directives is definitely a showstopper here, using cfg files
>> would imply to implement a semantic hack in order to achieve nested
>> directives or skip them at all. Both is not desireable.
>
> Agreed. So, the technical issues against cfg:
>
> - requirement for unique section headers
> - cannot support nested directives
>
> Where nested directives are still required in Plone context? I 
> remember seeing only <class><require/></class> (and in many cases 
> there would have been less lines with a single directive).
>
>> As alternative to cfg files YAML might be discussed, which actually
>> looks prettier than XML and can be used to describe nested structures.
>
> I also thought about YAML, but I'm not sure how widely it's adopted 
> elsewhere within Python developers. Also, it would be a completely new 
> syntax in Plone stack.
>
>> Anyway, i fear that there's not that big interest in changing or
>> extending the way ZCA registration works at all, as grok showed people
>> are basically fine with using ZCML (even if they're not big XML
>> enthusiasts) and prefer the use of not-so-loved syntax over another
>> package adding complexity and thus possible confusion.
>
> True.
>
> We have to teach a couple of new Plone developers every year. 
> Grok-approach has been easier for them to become productive, but 
> sooner or later there is the infamous Z-curve in learning. This time 
> where grok does not work and you still have to learn zcml. Next year 
> I've thinking about teaching zcml first, again...
>
> That's why I'm thinking about extending zope.configuration instead of 
> inventing something completely new (like grok was). That way it should 
> be easier to reach feature parity with zcml (because all the same 
> directives are used).
>
> Maybe zope.configuration could be extended to use venusian.scan to 
> register directives, when there is configure.py in your package..
This approach sounds nice and may get some positive feedback from the 
plone community. Having all directives available as python function 
calls (without the hassle of configuration context) sounds good.
Also using venusian for deferred configuration sounds good.

The problem i see here is that there needs to be a generic way of 
wrapping all available directive callbacks in order to avoid another 
registration function signature for each directive.

Regards, Robert
>
> Regards,
> Asko


------------------------------------------------------------------------------
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing 
conversations that shape the rapidly evolving mobile landscape. Sign up now. 
http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.