Open GoogleCodeExporter opened 9 years ago
Hmm, I wasn't aware of kernel32::WritePrivateProfileString. I agree that it
would be nice to be able to control the generated output to make it fit the
desired conventions.
A few other issues have come up in the past regarding other INI dialects that
differ from ConfigParser in small ways. There was the include syntax that
mercurial uses, and I remember someone complaining that iniparse did not allow
leading whitespace on lines.
To handle all these variations, I'm thinking of introducing an INIDialect
class. There will be a default dialect, and you'll also be able to pass in a
dialect to the constructor. Some common dialects could be pre-defined.
Dialects could affect the syntax in small ways, and control output formatting
like which separator to use and whether to put spaces around it.
Original comment by psobe...@gmail.com
on 23 Jun 2010 at 3:24
That sounds like a very good solution to it. I've listed a few other
inconsistencies in issue 24 (to not pollute this one, I should have just made
this one more general to start with). Those are also things for which an
INIDialect would fit the bill very nicely.
With your INIDialect class, you could have it auto-select a dialect to a
certain extent if it is given an open() argument -
fp.name.lower().endswith('.ini')
Original comment by chris.morganiser
on 23 Jun 2010 at 11:54
Original issue reported on code.google.com by
chris.morganiser
on 22 Jun 2010 at 1:55