Mercurial > hgrepos > Python > libs > ConfigMix
changeset 424:e60b72df15de
Introduction into sub-jails
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Tue, 07 Dec 2021 09:23:38 +0100 |
| parents | 5aba893d0dbb |
| children | 88d8de9310af |
| files | docs/introduction.rst |
| diffstat | 1 files changed, 15 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/docs/introduction.rst Thu Dec 02 09:32:01 2021 +0100 +++ b/docs/introduction.rst Tue Dec 07 09:23:38 2021 +0100 @@ -581,6 +581,21 @@ given `root path` in order to get the effective key into the base configuration. +It is possible to get a jailed configuration from an already jailed +configuration:: + + import configmix + + config = configmix.load("conf10.py") + value = config.getvar_s("tree1.tree2.key4") + + jailed_config1 = config.jailed(rootpath="tree1") + + jailed_config2 = jailed_config2.jailed(rootpath="tree2") + jvalue2 = jailed_config.getvarl_s("key4") + + assert value == jvalue2 == "get this as `tree1.tree2.key4'" + Custom filename extensions and custom loaders ---------------------------------------------
