|
From: Nicholas B. <nic...@mi...> - 2009-01-07 20:30:58
|
Hello- I have a need to read an ini file (that I have no control over) that uses ; as the comment marker. I found the following with respect to that: http://sourceforge.net/mailarchive/message.php?msg_id=46F666FC.8080500%40voidspace.org.uk > You should be able to switch over the dividers and comment markers that > ConfigObj allows by changing the regular expressions it uses for parsing. > > The regexes are class attributes of the ConfigObj class. Unfortunately > you probably need to modify all of them. This should be quite easy though. But, as I'm new to all of this, I have no idea how to set class attributes or what the correct regular expression(s) would be. Can anyone provide examples? Also, this particular ini file lists duplicate "keyword" names as a way to specify multiple parameters, like so: TrustedCACert=/etc/CA/admin.pem TrustedCACert=/etc/CA/client.pem This causes ConfigObj to barf--which is fine, because I don't need to read these values, I would just like to ignore the error and move on. Is this possible? Thanks for any help and excuse my voluminous ignorance... Nick |