Mercurial > hgrepos > Python > libs > ConfigMix
diff configmix/config.py @ 385:4beeb291926d
First documentation of getfirstvarl()
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Wed, 10 Nov 2021 02:11:12 +0100 |
| parents | 8c3aaa894089 |
| children | 13427f37abab |
line wrap: on
line diff
--- a/configmix/config.py Wed Nov 10 01:53:50 2021 +0100 +++ b/configmix/config.py Wed Nov 10 02:11:12 2021 +0100 @@ -102,6 +102,20 @@ return varvalue def getfirstvarl(self, *paths, **kwds): + """A variant of :meth:`~.getvarl` that returns the first found + variable in the `paths` list. + + Every item in `paths` is either a `tuple` or `list` or a `dict`. + If the path item is a `dict` then it must have two keys "namespace" + and "path". + If the path item is a `list` or `tuple` then the namespace is assumed + to be `None`. + + No variable interpolation is done and no filters are applied. + + Quoting of anything in `paths` is *not* needed and wrong. + + """ default = kwds.pop("default", _MARKER) for path in paths: if isinstance(path, (list, tuple)):
