Skip to content

Modular config parsing. #12

@exhuma

Description

@exhuma

Currently, config_resolver's main job is find files, conditionally load them, and load them in a particular order (precedence).

To read the values, it uses SafeConfigParser from the stdlib. For some use-cases, simple .ini files are a bit limiting.

It should be possible to pass in a custom file-parser module, overriding SafeConfigParser. As long as that parser offers a way to read the values needed by config_resolver (currently only the config-file version) it should work.

Additionally, the returned config instance should be of the overridden type. This allows the user to provide a completely customized parser without losing that parser's advanced features.

This will also decouple the file look-up from the config handling.

Leave SafeConfigParser as default if no other parser is specified to keep backwards compatibility.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions