# HG changeset patch # User Franz Glasner # Date 1626017311 -7200 # Node ID baedd2031074edc8412964531700044fdf84a360 # Parent 4d7ad20cb8f9956d7a381405c99e7241558f4ac1 Docs: Introduce the newly introduces access methods diff -r 4d7ad20cb8f9 -r baedd2031074 docs/introduction.rst --- a/docs/introduction.rst Sun Jul 11 17:28:01 2021 +0200 +++ b/docs/introduction.rst Sun Jul 11 17:28:31 2021 +0200 @@ -223,7 +223,7 @@ Because the configuration is not only a plain list of but a tree of key-value pairs you will want to fetch a nested configuration value -using two access methods: +using two access basic methods: :py:meth:`.Configuration.getvar` and :py:meth:`.Configuration.getvar_s` @@ -234,6 +234,18 @@ Use just positional Python arguments for each level key +Also there exist variants of the basic access methods that coerce +returned variables into :py:class:`int` or :py:class:`bool` types +(:py:meth:`.Configuration.getintvar_s`, +:py:meth:`.Configuration.getboolvar_s`) + +And with :py:meth:`.Configuration.getfirstvar`, +:py:meth:`.Configuration.getfirstvar_s`, +:py:meth:`.Configuration.getfirstintvar_s` and +:py:meth:`.Configuration.getfirstboolvar_s` there exist variants that +accept a *list* of possible variables names and return the first one +that is found. + Looking at the example in chapter :ref:`yaml-files` -- when calling ``config.getvar_s("tree1.tree2.key4")`` you will get the value ``get this as `tree1.tree2.key4'``.