[Baypiggies] Reading k=v format files

Joshua Rodman jrodman at splunk.com
Thu Oct 8 17:19:48 CEST 2015


On Thu, Oct 08, 2015 at 08:04:36AM -0700, Ian Zimmerman wrote:
> On 2015-10-08 06:32 -0700, Joshua Rodman wrote:
> 
> > http://stackoverflow.com/questions/2819696/parsing-properties-file-in-python/2819788#2819788
> 
> That would work, but is really more complicated than what I already do.
> Perhaps I could stick it in a local library ... but then I would have to
> create one :-) 

Agreed.

> > In my proprietary world, we put stuff outside a section in [default].
> 
> Not possible for me because it has to be shell syntax (see OP).

I meant our ini parser considers these files identical:

file1:
    [default]
    pie=apple
    swingset=4seats

file2:
    pie=apple
    swingset=4seats

It seems an obvious dialect which would cover the the common case of
"I don't care about these sections." 

It would also make them shell-compatible, modulo whitespace, quoting,
booleans, etc.
-- 
  O         O_/      O_/       Splunk.
 /|\/       /\      \/\ _                 /
/ |\       / |\        | \       \   / / /o
_/__|_     _/__|_     _/____      O__\/ /o   
 o  o       o  o       o  o      \/


More information about the Baypiggies mailing list