Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Python (http://www.velocityreviews.com/forums/f43-python.html)
-   -   RE: why does Configparser change names to lowercase ? (http://www.velocityreviews.com/forums/t538067-re-why-does-configparser-change-names-to-lowercase.html)

09-18-2007 02:17 AM

RE: why does Configparser change names to lowercase ?
 
This works ...

Cf=ConfigParser.ConfigParser()
Cf.optionxform=str
....

Blinston.
-----Original Message-----
From: python-list-bounces+blinston_fernandes=dell.com@python.org [mailto:python-list-bounces+blinston_fernandes=dell.com@python.org] On Behalf Of Joshua J. Kugler
Sent: Tuesday, September 18, 2007 3:44 AM
To: python-list@python.org
Subject: Re: why does Configparser change names to lowercase ?

On Friday 14 September 2007 12:21, stef mientki wrote:
> Why does Configparser change names to lowercase ?
>
> As Python is case sensitive (which btw I don't like at all ;-) but now
> when really need the casesensitivity, because it handles about names
> which should be recognized by human, it changes everything to
> lowercase ????
>
> thanks,
> Stef Mientki


According to the ConfigParser docs:

"All option names used in interpolation will be passed through the
optionxform() method just like any other option name reference. For example, using the default implementation of optionxform() (which converts option names to lower case), the values "foo %(bar)s" and "foo %(BAR)s" are equivalent."

So, it seems it would be trivial so sublcass ConfigParser, and reimplement
optionxform()

Hope that helps.

j

--
Joshua Kugler
Lead System Admin -- Senior Programmer
http://www.eeinternet.com
PGP Key: http://pgp.mit.edu/ *ID 0xDB26D7CE

--
http://mail.python.org/mailman/listinfo/python-list


All times are GMT. The time now is 01:32 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.