DiffSK/configobj

String interpolation using variables of other subsections

Closed this issue · 2 comments

I've been always using ConfigParser. Now that I have the need of using nested sections, I've found ConfigObj which seems to fit really my needs. The problem comes when I try to interpolate variables from other subsections. Is this possible? Otherwise the nested sections stop making sense in my case.

I have been looking for the interpolation syntax in configobj and it looks like this has not been implemented... I just wanted to be sure and to know other options to deal with this.

This is an example of what I would like to do:

[global]
    [[dirs]]
        software = /path-to-software-dir/
        dbs = /path-to-dbs-dir/

[A]
    [[softs]]
        soft1 = {global.dirs.software}/soft1
        soft2 = {global.dirs.software}/soft2
    [[dbs]]
        db1 = {global.dirs.dbs}/db1
        db2 = {global.dirs.dbs}/db2

Duplicate of #101.

Keeping #101 alive to collect "other section references".