Re: [Zope-dev] merge zope.configuration dictactions branch
On Mon, 2011-12-05 at 15:05 -0500, Chris McDonough wrote: On Mon, 2011-12-05 at 08:07 +0100, Wolfgang Schnerring wrote: * Chris McDonough chr...@plope.com [2011-12-05 04:02]: ssh://svn.zope.org/repos/main/zope.configuration/branches/chrism-dictactions I want to be able to associate a new value (introspectables) with each ZCML configuration action On the zope.configuration trunk (and in all past releases), each ZCML action is maintained as a tuple. The tuple can be of any length up to seven elements, but mustn't exceed a length of seven. the z.config code is much easier to understand when the action is just a dictionary instead of a pseudo-struct. +1, this makes a lot of sense to me. The chrism-dictactions branch was merged to trunk; the changes will be present in zope.configuration 3.8.0 (once released). I've released zope.configuration 3.8.0 with the aforementioned changes. - C ___ Zope-Dev maillist - Zope-Dev@zope.org https://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - https://mail.zope.org/mailman/listinfo/zope-announce https://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] merge zope.configuration dictactions branch
On Mon, 2011-12-05 at 08:07 +0100, Wolfgang Schnerring wrote: * Chris McDonough chr...@plope.com [2011-12-05 04:02]: ssh://svn.zope.org/repos/main/zope.configuration/branches/chrism-dictactions I want to be able to associate a new value (introspectables) with each ZCML configuration action On the zope.configuration trunk (and in all past releases), each ZCML action is maintained as a tuple. The tuple can be of any length up to seven elements, but mustn't exceed a length of seven. the z.config code is much easier to understand when the action is just a dictionary instead of a pseudo-struct. +1, this makes a lot of sense to me. The chrism-dictactions branch was merged to trunk; the changes will be present in zope.configuration 3.8.0 (once released). - C ___ Zope-Dev maillist - Zope-Dev@zope.org https://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - https://mail.zope.org/mailman/listinfo/zope-announce https://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] merge zope.configuration dictactions branch
Hi Chris, Am 05.12.2011, 04:02 Uhr, schrieb Chris McDonough chr...@plope.com: On the zope.configuration trunk (and in all past releases), each ZCML action is maintained as a tuple. The tuple can be of any length up to seven elements, but mustn't exceed a length of seven. A complex system of lengthening and shortening (in zope.configuration.config.resolveConflicts) tries to ensure that the tuple is of the smallest length required by chopping false elements off the end of each action tuple during storage and reconstituting them to 7-element tuples during processing and sorting. I think this juke was purely to make doctests easier to write, but I'm not entirely sure. eek! I'm sure there was a better reason for this in the first place. As things stand ZCML declarations are not orthogonal so a key-based approach seems the better fit. Up til now, pyramid_zcml could live with actions being at most 7 elements. But recent changes to the Pyramid trunk (adding introspectables) blew out the presumption that an action tuple could be no longer than 7 elements (it now might need to be 8 elements). Rather than extend the structure of the zope.configuration tuple with a Pyramid-only introspectables argument, I've created the chrism-dictactions branch (http://svn.zope.org/zope.configuration/branches/chrism-dictactions/) which changes ZCML action structures to be dictionaries. This allows each action to contain arbitrary keys. This modification satisfies the immediate requirement (adding introspectables) and allows us to never need to change the zope.config code again if more elements need to be added to actions. +1 as all ZTK test pass. I could have instead added an extras dictionary on to the end of the tuple as an 8th element, but it seems six of one a half dozen of another, and the z.config code is much easier to understand when the action is just a dictionary instead of a pseudo-struct. I'm trying to think of where I've seen that pattern of {'organised' 'others':{}} before... oh, yes in dodgy RDBMS schema. Charlie -- Charlie Clark Managing Director Clark Consulting Research German Office Kronenstr. 27a Düsseldorf D- 40217 Tel: +49-211-600-3657 Mobile: +49-178-782-6226 ___ Zope-Dev maillist - Zope-Dev@zope.org https://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - https://mail.zope.org/mailman/listinfo/zope-announce https://mail.zope.org/mailman/listinfo/zope )
[Zope-dev] merge zope.configuration dictactions branch
ssh://svn.zope.org/repos/main/zope.configuration/branches/chrism-dictactions Rationale: I want to be able to associate a new value (introspectables) with each ZCML configuration action, in support of ZCML support for Pyramid features described at: http://docs.pylonsproject.org/projects/pyramid/en/latest/narr/introspector.html http://docs.pylonsproject.org/projects/pyramid/en/latest/narr/extconfig.html#configuration-introspection A rough example UI for the feature is shown here: http://static.repoze.org/introspection/ On the zope.configuration trunk (and in all past releases), each ZCML action is maintained as a tuple. The tuple can be of any length up to seven elements, but mustn't exceed a length of seven. A complex system of lengthening and shortening (in zope.configuration.config.resolveConflicts) tries to ensure that the tuple is of the smallest length required by chopping false elements off the end of each action tuple during storage and reconstituting them to 7-element tuples during processing and sorting. I think this juke was purely to make doctests easier to write, but I'm not entirely sure. Up til now, pyramid_zcml could live with actions being at most 7 elements. But recent changes to the Pyramid trunk (adding introspectables) blew out the presumption that an action tuple could be no longer than 7 elements (it now might need to be 8 elements). Rather than extend the structure of the zope.configuration tuple with a Pyramid-only introspectables argument, I've created the chrism-dictactions branch (http://svn.zope.org/zope.configuration/branches/chrism-dictactions/) which changes ZCML action structures to be dictionaries. This allows each action to contain arbitrary keys. This modification satisfies the immediate requirement (adding introspectables) and allows us to never need to change the zope.config code again if more elements need to be added to actions. I could have instead added an extras dictionary on to the end of the tuple as an 8th element, but it seems six of one a half dozen of another, and the z.config code is much easier to understand when the action is just a dictionary instead of a pseudo-struct. All ZTK tests pass with the chrism-dictactions branch, and any code that depended upon the action structures was likely overstepping its bounds anyway. I'd like to merge this branch to the zope.configuration trunk as a result, and create a new release. The (unlikely) alternatives are: drop support for ZCML in Pyramid, drop plans to support introspectables in Pyramid. ___ Zope-Dev maillist - Zope-Dev@zope.org https://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - https://mail.zope.org/mailman/listinfo/zope-announce https://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] merge zope.configuration dictactions branch
* Chris McDonough chr...@plope.com [2011-12-05 04:02]: ssh://svn.zope.org/repos/main/zope.configuration/branches/chrism-dictactions I want to be able to associate a new value (introspectables) with each ZCML configuration action On the zope.configuration trunk (and in all past releases), each ZCML action is maintained as a tuple. The tuple can be of any length up to seven elements, but mustn't exceed a length of seven. the z.config code is much easier to understand when the action is just a dictionary instead of a pseudo-struct. +1, this makes a lot of sense to me. Wolfgang ___ Zope-Dev maillist - Zope-Dev@zope.org https://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - https://mail.zope.org/mailman/listinfo/zope-announce https://mail.zope.org/mailman/listinfo/zope )