lapinkoira
lapinkoira

Reputation: 9008

ConfigObject nested section without any parent setting

I am using http://www.voidspace.org.uk/python/configobj.html to parse my configuration and it looks like it doesnt allow you to do this:

[section 1]

    [[sub-section 1]]
    # this is in section 1
    keyword1 = value1
    keyword2 = value2

    [[sub-section 2]]
    # this is in section 1
    keyword1 = value1
    keyword2 = value2

It crashes with a:

ParsingError: File contains parsing errors:

If I want to have a list of configurations, like a list of ftp configurations I must provide some useless settings to the parent so it doenst complain like this:

[section 1]
    amIUseless = yesYouAre
    [[sub-section 1]]
    # this is in section 1
    keyword1 = value1
    keyword2 = value2

    [[sub-section 2]]
    # this is in section 1
    keyword1 = value1
    keyword2 = value2

Is this intended? am I doing anything wrong? Can I avoid adding that useless setting?

Upvotes: 1

Views: 206

Answers (0)

Related Questions