[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: Branko Čibej <brane_at_xbc.nu>
Date: 2003-03-07 19:10:58 CET

Daniel Rall wrote:

>=?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?
>
Hm, my experience (and understanding of the docs) is different; perheps
this did change between 2.0 and 2.2. I guess it's not that hard to
implement this behaviour (in fact, it would help you with the variable
expansion semantics), so +1 if you care to do it.

>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?
>
>
Yes, there seems to be some confusion. I'd say go ahead and reproduce
the behaviour you showed above. Luckily, we've thrown out the only use
of [default] we had till now.

We do have one big difference, though -- our section and option names
are case-insensitive. That's intentional, and I thing we should keep it.

-- 
Brane Čibej   <brane_at_xbc.nu>   http://www.xbc.nu/brane/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Mar 7 19:11:42 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.