Skip to content
This repository has been archived by the owner on Dec 5, 2023. It is now read-only.

INI serialization support #10

Closed
stephen-bunn opened this issue Nov 8, 2018 · 2 comments · Fixed by #11
Closed

INI serialization support #10

stephen-bunn opened this issue Nov 8, 2018 · 2 comments · Fixed by #11
Assignees
Labels
enhancement Enhances existing feature
Milestone

Comments

@stephen-bunn
Copy link
Owner

Expected Behavior

I want to also add support for dumping to and loading from .ini files.
Should add a dumps_ini and loads_ini methods.

Current Behavior

There is no support 😞

Possible Solution

Most likely I can just use configparser.
Particularly the read_dict method will be helpful.


❤️ Thank you!

@stephen-bunn stephen-bunn added the enhancement Enhances existing feature label Nov 8, 2018
@stephen-bunn stephen-bunn self-assigned this Nov 8, 2018
@stephen-bunn
Copy link
Owner Author

While looking through configparser and how this could be implemented I'm noticing how crappy the configparser library really is.

ConfigParser doesn't handle:

  • Nested dictionaries (treated as strings)
  • Lists (treated as strings)
  • Proper typing (everything is considered to be a string)

I'm unsure if this is part of the ini spec but it's pretty damn bad.
So any kind of serialization and loading methods using ConfigParser will need to have custom logic for writing the content in a restoreable manner.

@stephen-bunn stephen-bunn mentioned this issue Nov 13, 2018
2 tasks
@stephen-bunn
Copy link
Owner Author

Solution to dealing with this is just to create a custom ConfigParser class which deals with the serialization and de-serialization of the parser instance.

@stephen-bunn stephen-bunn added this to the 0.3.0 Release milestone Nov 15, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Enhances existing feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant