Re: [Rest2web-develop] Changed all references to value "tests" into value "checks"...
Brought to you by:
mjfoord
From: Nicola L. <ni...@te...> - 2005-07-21 12:24:18
|
> I think it makes the config files look more confusing. We use > indentation for nesting sections. *so*, you either use what I have done > so far, or you have to indent values *inside* a section. > > Mine (a section indented uniformly) : > > key = value > key2 = value2 > [section] > key = value > key2 = value2 > [sub-section] > key = value > key2 = value2 > > [section2] > key = value > key2 = value2 Wait a minute, how is this compatible with std INI files? ConfigObj reads them in flat, then writes them nested, but ConfigParser then keeps reading them because it doesn't care for indent? They will *look* different to humans, though, after having passed through ConfigObj. :-) > Yours (values indented differently from their markers) : This is *not* what I was getting at. :-) > key = value > [section] > key = value # if you don't indent here > key2 = value2 # there's no way to distinguish > [sub-section] # this sub-section from section2 What do you mean, there's no way?!? The section2 header ends it! Any (sub)section marker ends any previous (sub) section. > key = value > key2 = value2 > > [section2] > key = value > key2 = value2 > > > In your spec values have to be indented more than their section marker > which is equally confusing. Added to which implementing your spec is > *substantially* harder (for no gain IMHO). That's not my spec. Here's what I have in mind: key = value key2 = value2 [section] key = value key2 = value2 # no scalar values allowed here [sub-section] key = value key2 = value2 # no scalar values allowed here [section2] key = value key2 = value2 In summary, starting from your version, I just suggest to dedent everything one position (except for top level scalar values that are already at column one, of course). This looks clearer to me, and if one doesn't use subsections, it is *identical* to INI config files. > Hmm... this has been then *only* implementation I've done of this (as > shown in the tests) - so it's a long way down the road to start > discussing the basics. I don't get exactly what you imply by saying this. I wasn't there early on, sure, but nonetheless I hope it's not too late to try and get the basics right. -- Nicola Larosa - ni...@te... When I was growing up, my parents used to say to me, "Tom, finish your dinner - people in China are starving." But after sailing to the edges of the flat world for a year, I am now telling my own daughters, "Girls, finish your homework - people in China and India are starving for your jobs." -- Thomas L. Friedman, New York Times, April 2005 |