[Distutils] [zc.buildout] "Adding and removing options" section unclear

Chris Withers chris at simplistix.co.uk
Tue Jul 15 22:03:31 CEST 2008


Jim Fulton wrote:
> 
>> Okay, I don't know if there's a "this is how sections, names and 
>> values" work section but if there isn't, there should be, and if there 
>> is, I missed it
> 
> http://pypi.python.org/pypi/zc.buildout/1.0.6#configuration-file-syntax

Okay, but that doesn't mention splitting on spaces ;-) It's also below 
stuff dealing with writing recipe clases, etc, which seems weird as 
understanding the format of the .cfg file seems pretty integral to using 
buildout from the get-go :-S

>> and I don't remember reading anything about how and where values are 
>> split ;-)
> 
> Parsing of option values is specific to individual recipes, so it isn't 
> part of the general syntax.  Having said that, many many options are 
> treated as white-space delimited sequences of values. The += and -= 
> syntax is only useful for options that have this form.  The 
> documentation should have said more about this.

...and I'm still left baffled.

so:

- the parsing of the value is soley up to the recipe
- but += -= are "buildout" things that can be applied to all values, no 
matter their recipe
- and many many options, but not all, are treated as whitespace 
delimited sequences of values

um...

:'(

(I don't know the emoticon for an exploding head)

>> and therefore is it just convention that prevents a recipe from 
>> splitting on other characters too?)
> 
> Yes. In fact, if values can have spaces in them, then a option may be 
> split on new lines.  For example the eggs option in many recipes, which 
> should really be named "requirements", is split on new lines because the 
> individual values can have spaces in them.

So what happens if I use += or -= with the eggs option?
(and I've wanted to do just this in the past, but didn't even know I 
could...)

cheers,

Chris

-- 
Simplistix - Content Management, Zope & Python Consulting
            - http://www.simplistix.co.uk


More information about the Distutils-SIG mailing list