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

Read-only config? #166

Open
haizaar opened this issue Oct 18, 2018 · 2 comments
Open

Read-only config? #166

haizaar opened this issue Oct 18, 2018 · 2 comments

Comments

@haizaar
Copy link
Collaborator

haizaar commented Oct 18, 2018

Hi again,

If there a way to "freeze" a config? I.e. something like:

config = Config(schema={"name": "foo"}, frozen=True)
config.name = bar  # Should raise!
@jbasko
Copy link
Owner

jbasko commented Oct 20, 2018

With normal Config I need more investigation. With PlainConfig you can try out this branch:

pip install git+https://github.com/jbasko/configmanager.git@explore-read-only

config = PlainConfig(schema={"name": "foo"}, read_only=True)

@haizaar
Copy link
Collaborator Author

haizaar commented Oct 22, 2018

Works nice! Got

RuntimeError: surname is read-only

Many thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants