[Zconfig] Text blocks in ZConfig

Fred L. Drake, Jr. fdrake at acm.org
Fri Feb 4 17:29:34 EST 2005


I've added a concrete proposal for support text blocks in ZConfig to the 
ZConfig wiki:

    http://dev.zope.org/Zope3/ZConfig

Since the proposal is short, I'm including it here as well.  Since I have need 
of this, I'd like to hear objections to the details sooner rather than later.

Here's a possible text block possibility:  The text block can be defined in 
the schema as a 'sectiontype' with a 'type="text"' attribute ('sectiontype' 
does not currently have a 'type' attribute).  The configuration syntax for 
the text block section will not need to differ from that of any other 
section, but the processing of the content will be different.

An example schema that defines a text block value might be::

    <schema>
        <sectiontype name="explanation" type="text" />
        <section type="why"
                 attribute="explanation" />
    </schema>

A corresponding configuration file that specifies a value for this might be:

    <why>
        This explains why the world is flat.

        You'd better sit down; there's a lot to this.
    </why>

The result of parsing the configuration file would be a configuration object 
that provides a single attribute, 'explanation'.  The value of the attribute 
would be a simple string.


  -Fred

-- 
Fred L. Drake, Jr.  <fdrake at acm.org>



More information about the ZConfig mailing list