Mercurial > hgrepos > Python > libs > ConfigMix
changeset 399:b45403d175a0
Docs
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Fri, 19 Nov 2021 01:59:42 +0100 |
| parents | b1f82b853290 |
| children | 727ec2fc8e7e |
| files | configmix/config.py |
| diffstat | 1 files changed, 22 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/configmix/config.py Fri Nov 19 01:39:18 2021 +0100 +++ b/configmix/config.py Fri Nov 19 01:59:42 2021 +0100 @@ -652,11 +652,19 @@ return ''.join(res) def jailed(self, rootpath=None, root=None): - """Return a "jailed" configuration. + """Return a "jailed" configuration of the current configuration. + :param rootpath: a sequence of strings that shall emcompass + the chroot-like jail of the returned + configuration + :type rootpath: list or tuple + :param str root: a string path expression that shall encompass + the chroot-like jail of the returned configuration :return: a jailed (aka restricted) configuration :rtype: _JailedConfiguration + Exactly one of `rootpath` or `root` must be given. + """ if rootpath is not None and root is not None: raise ValueError("only one of `rootpath' or `root' can be given") @@ -680,7 +688,19 @@ """A jailed and restricted variant of :class:`Configuration`. - No namespace support. + Restriction is two-fold: + + - The access to configuration variables in `config` is restricted + to the configuration sub-tree that is configured in `path`. + + - Not all access-methods of :class:`Configuration` are implemented + yet. + + .. note:: There is no namespace support. + + .. note:: Do not call the constructor directly. Instantiate a jailed + configuration from the parent configuration's + :meth:`~.Configuration.jailed` factory method. """
