[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [1165] strictness of svn_config to Python's ConfigParser API

From: Daniel Rall <dlr_at_finemaltcoding.com>
Date: 2003-03-07 17:47:54 CET

=?UTF-8?B?QnJhbmtvIMSMaWJlag==?= <brane@xbc.nu> writes:

> Daniel Rall wrote:
>
...
> >1) [DEFAULT] section isn't handled (should provide default values for
> >all other sections)
>
> IIRC, [DEFAULT] provides defaults for /vadiable expansions/ in other
> sections, not just any old defaults. So this is contingent on variable
> expansion.

Python 1.5.2 and 2.2 is showing me slightly different behavior:

[DEFAULT]
foo=bar

[section1]
baz=frob

>>> cfg = ConfigParser.ConfigParser()
>>> cfg.read('config-test.cfg')
>>> cfg.get('section1', 'foo')
'bar'

This behavior strikes me as quite useful in many scenarios. However,
I'm not certain where the SVN config files would use it. Thoughts?

> The /defaults/ parameter to the ConfigParser constructor is something
> else, and IMHO we don't need it.

Sounds good to me.

> >2) Variable substitution isn't handled (duh)
>
> This pertains directly to file contents interpretation, so yes, I'd like
> to see it in.

Of course.

> >3) __name__ option isn't handled (should default to the name of the
> >section)
>
> This is an API issue, again, and I we don't need it.

Okay.

> >#2 sees like the main target, but I was curious if I should bother
> >implementing #1 and #3. It would allow us to just point to the
> >ConfigParser documentation for our interface contract, but would also
> >result in a slightly more complex implementation.
> >
> >http://subversion.tigris.org/issues/show_bug.cgi?id=1165
>
> I'd say just go with #2, and the appropriate handling of the [DEFAULT]
> section for variable expansion. Again: [DEFAULT] does not provide
> default values for any option, only for variable expansion if the
> placeholder name is not found in the current section.

The description of [DEFAULT] doesn't match what I'm seeing. The
Python docs don't describe it in detail, so there's bound to be
confusion -- perhaps I misunderstand?

-- 
Daniel Rall <dlr@finemaltcoding.com>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Mar 7 17:48:31 2003

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.