ok up to dynfam

This commit is contained in:
gwen 2026-01-28 16:15:02 +01:00
parent c368334d05
commit 887f5794af
4 changed files with 40 additions and 7 deletions

View file

@ -50,3 +50,9 @@ Unknown user data error
l'option "`--cli.unknown_user_data_error`", ca ressemble à "`--cli.invalid_user_data_error`" mais ca concerne là les variables inconnues (ou ici désactivé ou hidden mais ca reviens au meme pour moi) chargés dans des user data.
https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_050/README.md#output-when-unknown-user-data-is-an-error
.. note:: The `--cli.unknown_user_data_error` option changes the behaviour of the Rougail CLI's standard output:
when an unknown (or disabled or hidden) variable is declared in the :term:`user data file <user data>`
then it appears in the output as an error instead of a warning.

View file

@ -152,6 +152,15 @@ We can see here that the `address` variable's default value is conditionned by t
The target variable is `manual.http_proxy.address`.
.. note:: The `__.` notation means the parent path of the current subfamily path.
In the python quasi algorithmic notation we could say that:
.. code-block:: python
__.http_proxy.address == http_proxy.address
This is true only because in our use case `http_proxy.address` is located
in the same `manual` subfamiliy than `https_proxy.address`.
We then say that the `manual.https_proxy.address` and the `manual.https_proxy.port` default values are *calculated*.

View file

@ -103,7 +103,7 @@ So what does this disabled property exactly?
It makes the :term:`configuration` act as if the variable or family that has this property has not even been defined.
It simply doesn't exist (it is deactivated) for the whole configuration.
.. note:: Note that, as with any property, if a family has been disabled, all variables and sub-families that it contains are disabled.
.. note:: Note that if a family has been disabled, all variables and sub-families that it contains are disabled.
And if we try to assign values to variables that have been disabled, here is what happens:
@ -120,6 +120,10 @@ If we launch the Rougail CLI:
..
rougail -m firefox/ -u yaml -yf config/02/config.yml --cli.unknown_user_data_error
.. note:: The `--cli.unknown_user_data_error` option changes the behaviour of the Rougail CLI's standard output:
when an unknown (or disabled or hidden) variable is declared in the :term:`user data file <user data>`
then it appears in the output as an error instead of a warning.
It outputs:
.. raw:: html
@ -438,6 +442,20 @@ Here is our new :file:`20-manual.yml` structure file:
We have now a `hidden` property assigned to the `https_proxy` family, which is
hiding these two variables.
.. questions:: Why a `hidden` property?
Here is a detailed explanation of this choice of the `hidden` property:
We are in a use case where we want the HTTP mode configuration to be identical to the HTTPS mode configuration, so:
- we need to have access to the HTTP mode configuration details
- this HTTP configuration will be duplicated using references to the default values,
so there is no need to request intervention from the :term:`operator`
to fill in the details of the default HTTPS configuration
- however, the :term:`operator` may want to have access to the HTTPS mode configuration if he wishes to,
in order to assign customised values to it.
Therefore, the :term:`operator` must obviously be able to access this HTTPS configuration.
If we launch the Rougail CLI on the this user data
.. extinclude:: https://forge.cloud.silique.fr/stove/rougail-tutorials/raw/tag/v1.1_052/config/01/config.yml
@ -526,7 +544,7 @@ We have this output:
We call this mode the `RW` mode. In this mode you can edit the variables, even these that have
been hidden or disabled.
Why these modes ? In this way, the :term`operator` or the :term:`integrator` don't have to
Why these modes ? In this way, the :term:`operator` or the :term:`integrator` don't have to
add or pop familiy properties each time we pass from one use (editing mode) to another
(configuration using mode) to an other. Swithching modes with setting properties is not a good idea.
It's better to change the read write and the read_only mode inside a Rougail CLI session.

View file

@ -177,7 +177,7 @@ This identifier is a parameter that enables us to create two families named `htt
Here the family name is: `"{{ identifier }}_proxy"`.
If you define a dynamically built family with the `https` item that will
If you define a dynamically built family with the `https` identifer that will
build a `https_proxy` family and if this familiy already exists,
then rougail will raise a family/variable override warning.
@ -284,10 +284,10 @@ A conditional disabled variable with dynamic identifier
git switch --detach v1.1_061
Here is the final version of the HTTPS and SOCKS structure file, we have added:
- a conditional hidden family property
- a default value
Here is the final version of the HTTPS and SOCKS structure file, we have added
a new variable named `version`, with the `choice` type, with a default value,
and which has the `disabled` property if the :term:`configuration` is in the `SOCKS` situation.
We will look at this in more detail below.
.. extinclude:: https://forge.cloud.silique.fr/stove/rougail-tutorials/raw/tag/v1.1_061/firefox/20-manual.yml
:language: yaml