kynikos / lib.py.configfile

Python library to dynamically parse and edit configuration files with support for subsections.
https://kynikos.github.io/lib.py.configfile/
MIT License
2 stars 1 forks source link

Make 'sources' understand file-like objects #1

Closed lahwaacz closed 9 years ago

lahwaacz commented 9 years ago

It would be nice if the 'sources' parameter could understand already-created file-like objects, e.g. files open by some other library or "virtual" streams. This works nicely for my use case, but you may need to update some other parts (including the top-level documentation).

In the future it would be even nicer to expose the same types for serialization, i.e. export to targets specified by file names, file-like objects, dictionaries etc. But I'm nowhere near testing this part yet...

kynikos commented 9 years ago

Merged, thank you! About exporting by serialization, there are already the get_options, get_sections and get_tree methods, is that part of what you meant? Probably what's currently missing is only exporting to a file-like object (the natural complement to this patch): #26. Please elaborate there if I didn't get it right :)