Open paternal opened 6 years ago
As you say, it appears the answer is no. I think multi-line values could be supported by subclassing Dialect
and customizing (just) the tokenize
and (probably) the kv_serialize
methods.
As for differences from configparser
, the biggest ones (the ones hardest to hack back in) seems to be:
configparser
does not have any mechanism that preserves comments and blank lines if a .ini file is edited by loading it, modifying the ConfigParser
then writing it back out.configparser
does not appear to support any key/value settings before the first section header. In fact it raises a MissingSectionHeaderError when such settings are found. (Lektor and/or its plugins uses some of these.)configparser
does not appear to support any kind of quoting of the value in key/value pairs. It also seems to always strip any leading and trailing white-space from values (and from each line of multi-line values).The API for accessing the config data differs between IniFile
and ConfigParser
. IniFile
presents a flat dict with keys of the form <section>.<key>
, while ConfigParser
presents roughly a nested-dict interface. But, if that matters, I think an adapter could be constructed to make a ConfigParser
look like an IniFile
as far as data access.
I think that the answer is no, but I am asking anyway. It can be handy to store long values.
Side-question: What are the features of this package that stdlib configparser is missing (asking since multi-line values are handled by configparser)?
-- Louis