Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > ConfigParser Keys

Reply
Thread Tools

ConfigParser Keys

 
 
Neil Benn
Guest
Posts: n/a
 
      06-21-2004
Hello,

To my chagrin, I've just discovered that SafeConfigParser, by
default, returns all the keys in the key/value pairing in lowercase
(what earthly possible reason it would do this I do not know!). Does
anyone know of a way of stopping it doing this?

Cheers,

Neil

--

Neil Benn
Senior Automation Engineer
Cenix BioScience
BioInnovations Zentrum
Tatzberg 47
D-01307
Dresden
Germany

Tel : +49 (0)351 4173 154
e-mail : http://www.velocityreviews.com/forums/(E-Mail Removed)
Cenix Website : http://www.cenix-bioscience.com


 
Reply With Quote
 
 
 
 
Peter Otten
Guest
Posts: n/a
 
      06-21-2004
Neil Benn wrote:

> To my chagrin, I've just discovered that SafeConfigParser, by
> default, returns all the keys in the key/value pairing in lowercase
> (what earthly possible reason it would do this I do not know!). Does


The config file may be edited by a non-programmer. It is a safe assumption
that he will expect KEY=value, key=value and Key=value to affect the same
option.

> anyone know of a way of stopping it doing this?


Untested:

class CaseSensitiveSafeOptionParser(SafeOptionParser):
def optionxform(self, optionstr):
return optionstr

Peter

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ConfigParser: Can I read(ConfigParser.get()) a configuration file anduse it to call a funciton? jamitwidme@gmail.com Python 3 06-26-2008 08:01 PM
How to link foreign keys & primary keys using python? Harry George Python 9 06-13-2006 06:29 AM
can std::set hold pointers to keys instead of the keys themselves? danibe@my-deja.com C++ 10 02-03-2006 03:44 AM
serial keys/validation keys sandeep Kanwal C++ 1 10-29-2004 06:36 PM
keyboard keys replacing mouse keys? larry Computer Support 8 09-14-2003 07:32 PM



Advertisments