I need to parse (and feed to a database) configuration files like this one (actually it is Asterisk
's sip.conf
):
[client-template](!,natted-template)
foo=foovalue
moo=moovalue
[client](client-template)
bar=barvalue
This syntax means that client-template
is a template itself (because of !
in parentheses) based on natted-template
(defined elsewhere). And client
is an object definition, based on client-template
.
I could use ConfigParser
, but it looks like I need something more powerful or customized?