mitsuhiko / python-inifile

Ini file library for Python
Other
32 stars 6 forks source link

Does inifile support multiline values? #9

Open paternal opened 6 years ago

paternal commented 6 years ago

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

dairiki commented 1 year 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:

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.