Mercurial > hgrepos > Python > libs > ConfigMix
changeset 202:2e66178a09d8
Docu: Ban "keyword expansion" -- use "variable interpolation" instead
"Variable interpolation" or "variable expansion" or "variable substitution"
are the proper wordings.
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Sun, 05 May 2019 12:07:27 +0200 |
| parents | 24f4ab79a3ab |
| children | b2a5442867e7 |
| files | README.txt configmix/config.py configmix/variables.py doc/introduction.rst |
| diffstat | 4 files changed, 14 insertions(+), 14 deletions(-) [+] |
line wrap: on
line diff
--- a/README.txt Sun May 05 12:01:33 2019 +0200 +++ b/README.txt Sun May 05 12:07:27 2019 +0200 @@ -27,8 +27,8 @@ It then merges the parsed contents of given files into a *unified* tree-ish configuration dictionary and presents them as such to the -application. Reading can be done with keyword expansion from other -configuration values. +application. Reading can be done with variable interpolation from +other configuration values. References and Inspirations
--- a/configmix/config.py Sun May 05 12:01:33 2019 +0200 +++ b/configmix/config.py Sun May 05 12:07:27 2019 +0200 @@ -58,7 +58,7 @@ """Get a variable of the form ``[ns:][[key1.]key2.]name`` - including variables from other namespaces. - No variable expansion is done and no filters are applied. + No variable interpolation is done and no filters are applied. """ varns, varname = self._split_ns(varname) @@ -80,10 +80,10 @@ """Get a variable - including variables from other namespaces. `varname` is interpreted as in :meth:`.getvar`. But variables - will be expanded recursively within the variable values and - filters are applied. + will be interpolated recursively within the variable values + and filters are applied. - For more details see chapter :ref:`variable-expansion`. + For more details see chapter :ref:`variable-interpolation`. """ try:
--- a/configmix/variables.py Sun May 05 12:01:33 2019 +0200 +++ b/configmix/variables.py Sun May 05 12:07:27 2019 +0200 @@ -3,7 +3,7 @@ # :Copyright: (c) 2015-2019, Franz Glasner. All rights reserved. # :License: 3-clause BSD. See LICENSE.txt for details. #- -"""Variable expansion: implementation of namespaces and filters +"""Variable interpolation: implementation of namespaces and filters """
--- a/doc/introduction.rst Sun May 05 12:01:33 2019 +0200 +++ b/doc/introduction.rst Sun May 05 12:07:27 2019 +0200 @@ -201,7 +201,7 @@ Getting configuration variables ------------------------------- -Get a -- possibly expanded -- configuration variable's value with:: +Get a -- possibly interpolated -- configuration variable's value with:: value1 = config.getvar_s("key1") @@ -220,7 +220,7 @@ This is true for both methods :py:meth:`.Configuration.getvar` and :py:meth:`.Configuration.getvar_s`. -Both methods also perform :ref:`variable-expansion` and handle +Both methods also perform :ref:`variable-interpolation` and handle :ref:`variable-namespaces`. Filtering is not supported. So -- the variable name arguments of :py:meth:`.Configuration.getvar` and :py:meth:`.Configuration.getvar_s` are of the form @@ -291,14 +291,14 @@ yields the current working directory as :py:func:`os.getcwd` does. -.. _variable-expansion: +.. _variable-interpolation: -Variable Expansion ------------------- +Variable Interpolation +---------------------- Configuration variable values that are read with :py:meth:`.Configuration.getvar_s` are subject to variable -expansion. The general syntactic pattern for this is:: +interpolation. The general syntactic pattern for this is:: {{[namespace:]variable[|filter[|filter...]]}} @@ -306,7 +306,7 @@ a colon ``:``, the `variable` and then zero or more filters, each one introduced by a pipe symbol ``|``. -Variables are expanded lately at runtime -- exactly when calling +Variables are expanded *lately* at runtime -- exactly when calling :py:meth:`.Configuration.getvar_s`, :py:meth:`.Configuration.substitute_variables_in_obj` or :py:meth:`.Configuration.expand_variable`
