fix: description for all calculations

This commit is contained in:
egarette@silique.fr 2025-05-04 14:29:51 +02:00
parent 96866e99a4
commit f0f3fc899d
918 changed files with 1254 additions and 93 deletions

View file

@ -5,8 +5,8 @@
msgid ""
msgstr ""
"Project-Id-Version: \n"
"POT-Creation-Date: 2025-04-29 23:02+0200\n"
"PO-Revision-Date: 2025-04-29 23:06+0200\n"
"POT-Creation-Date: 2025-05-03 22:46+0200\n"
"PO-Revision-Date: 2025-05-03 22:48+0200\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: fr\n"
@ -68,87 +68,91 @@ msgstr "vérifier le mode existe déjà"
msgid "Generate document in format"
msgstr "Générer le document au format"
#: src/rougail/output_doc/doc.py:89
#: src/rougail/output_doc/doc.py:90
msgid "mandatory"
msgstr "obligatoire"
#: src/rougail/output_doc/doc.py:90
#: src/rougail/output_doc/doc.py:91
msgid "hidden"
msgstr "cachée"
#: src/rougail/output_doc/doc.py:91
#: src/rougail/output_doc/doc.py:92
msgid "disabled"
msgstr "désactivé"
#: src/rougail/output_doc/doc.py:92
#: src/rougail/output_doc/doc.py:93
msgid "unique"
msgstr "unique"
#: src/rougail/output_doc/doc.py:93
#: src/rougail/output_doc/doc.py:94
msgid "auto modified"
msgstr "auto modifiée"
#: src/rougail/output_doc/doc.py:307
#: src/rougail/output_doc/doc.py:309
msgid "This family contains lists of variable blocks."
msgstr "Cette famille contient des listes de bloc de variable."
#: src/rougail/output_doc/doc.py:315
#: src/rougail/output_doc/doc.py:317
msgid "This family builds families dynamically."
msgstr "Cette famille construit des familles dynamiquement."
#: src/rougail/output_doc/doc.py:345
#: src/rougail/output_doc/doc.py:347
msgid "multiple"
msgstr "multiple"
#: src/rougail/output_doc/doc.py:366
#: src/rougail/output_doc/doc.py:368
msgid "No attribute \"description\" for \"{0}\" in {1}"
msgstr "Aucun attribut \"description\" pour \"{0}\" dans {1}"
#: src/rougail/output_doc/doc.py:480
#: src/rougail/output_doc/doc.py:482
msgid "(default)"
msgstr "(défaut)"
#: src/rougail/output_doc/doc.py:487
#: src/rougail/output_doc/doc.py:489
msgid "text based with regular expressions \"{0}\""
msgstr "texte avec expression rationnelle \"{0}\""
#: src/rougail/output_doc/doc.py:574
#: src/rougail/output_doc/doc.py:578
msgid "depends on a calculation"
msgstr "dépend d'un calcul"
#: src/rougail/output_doc/doc.py:575
#: src/rougail/output_doc/doc.py:579
msgid "\"{0}\" is a calculation for {1} but has no description in {2}"
msgstr "\"{0}\" est un calcul pour {1} mais n'a pas de description dans {2}"
#: src/rougail/output_doc/doc.py:597
#: src/rougail/output_doc/doc.py:600 src/rougail/output_doc/doc.py:670
msgid "depends on an undocumented variable"
msgstr "dépends d'une variable non documentée"
#: src/rougail/output_doc/doc.py:599
#: src/rougail/output_doc/doc.py:602
msgid "when the variable \"{0}\" hasn't the value \"{1}\""
msgstr "lorsque la variable \"{0}\" n'a pas la valeur \"{1}\""
#: src/rougail/output_doc/doc.py:601
#: src/rougail/output_doc/doc.py:604
msgid "when the variable \"{0}\" has the value \"{1}\""
msgstr "lorsque la variable \"{0}\" a la valeur \"{1}\""
#: src/rougail/output_doc/doc.py:616
#: src/rougail/output_doc/doc.py:619
msgid "the value of the variable \"{0}\""
msgstr "la valeur de la variable \"{0}\""
#: src/rougail/output_doc/doc.py:617
#: src/rougail/output_doc/doc.py:620
msgid "the value of an undocumented variable"
msgstr "la valeur d'une variable non documentée"
#: src/rougail/output_doc/doc.py:648
#: src/rougail/output_doc/doc.py:651
msgid "the values of undocumented variables"
msgstr "les valeurs de variables non documentées"
#: src/rougail/output_doc/doc.py:655
#: src/rougail/output_doc/doc.py:668
msgid "{0} (from an undocumented variable)"
msgstr "{0} (issu d'une variable non documentée)"
#: src/rougail/output_doc/doc.py:679
msgid "the value of the identifier"
msgstr "la valeur de l'identifiant"
#: src/rougail/output_doc/doc.py:659
#: src/rougail/output_doc/doc.py:683
msgid "the value of the {0}"
msgstr "la valeur de l'{0}"

View file

@ -5,7 +5,7 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2025-04-29 23:06+0200\n"
"POT-Creation-Date: 2025-05-03 22:48+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -67,87 +67,91 @@ msgstr ""
msgid "Generate document in format"
msgstr ""
#: src/rougail/output_doc/doc.py:89
#: src/rougail/output_doc/doc.py:90
msgid "mandatory"
msgstr ""
#: src/rougail/output_doc/doc.py:90
#: src/rougail/output_doc/doc.py:91
msgid "hidden"
msgstr ""
#: src/rougail/output_doc/doc.py:91
#: src/rougail/output_doc/doc.py:92
msgid "disabled"
msgstr ""
#: src/rougail/output_doc/doc.py:92
#: src/rougail/output_doc/doc.py:93
msgid "unique"
msgstr ""
#: src/rougail/output_doc/doc.py:93
#: src/rougail/output_doc/doc.py:94
msgid "auto modified"
msgstr ""
#: src/rougail/output_doc/doc.py:307
#: src/rougail/output_doc/doc.py:309
msgid "This family contains lists of variable blocks."
msgstr ""
#: src/rougail/output_doc/doc.py:315
#: src/rougail/output_doc/doc.py:317
msgid "This family builds families dynamically."
msgstr ""
#: src/rougail/output_doc/doc.py:345
#: src/rougail/output_doc/doc.py:347
msgid "multiple"
msgstr ""
#: src/rougail/output_doc/doc.py:366
#: src/rougail/output_doc/doc.py:368
msgid "No attribute \"description\" for \"{0}\" in {1}"
msgstr ""
#: src/rougail/output_doc/doc.py:480
#: src/rougail/output_doc/doc.py:482
msgid "(default)"
msgstr ""
#: src/rougail/output_doc/doc.py:487
#: src/rougail/output_doc/doc.py:489
msgid "text based with regular expressions \"{0}\""
msgstr ""
#: src/rougail/output_doc/doc.py:574
#: src/rougail/output_doc/doc.py:578
msgid "depends on a calculation"
msgstr ""
#: src/rougail/output_doc/doc.py:575
#: src/rougail/output_doc/doc.py:579
msgid "\"{0}\" is a calculation for {1} but has no description in {2}"
msgstr ""
#: src/rougail/output_doc/doc.py:597
#: src/rougail/output_doc/doc.py:600 src/rougail/output_doc/doc.py:670
msgid "depends on an undocumented variable"
msgstr ""
#: src/rougail/output_doc/doc.py:599
#: src/rougail/output_doc/doc.py:602
msgid "when the variable \"{0}\" hasn't the value \"{1}\""
msgstr ""
#: src/rougail/output_doc/doc.py:601
#: src/rougail/output_doc/doc.py:604
msgid "when the variable \"{0}\" has the value \"{1}\""
msgstr ""
#: src/rougail/output_doc/doc.py:616
#: src/rougail/output_doc/doc.py:619
msgid "the value of the variable \"{0}\""
msgstr ""
#: src/rougail/output_doc/doc.py:617
#: src/rougail/output_doc/doc.py:620
msgid "the value of an undocumented variable"
msgstr ""
#: src/rougail/output_doc/doc.py:648
#: src/rougail/output_doc/doc.py:651
msgid "the values of undocumented variables"
msgstr ""
#: src/rougail/output_doc/doc.py:655
#: src/rougail/output_doc/doc.py:668
msgid "{0} (from an undocumented variable)"
msgstr ""
#: src/rougail/output_doc/doc.py:679
msgid "the value of the identifier"
msgstr ""
#: src/rougail/output_doc/doc.py:659
#: src/rougail/output_doc/doc.py:683
msgid "the value of the {0}"
msgstr ""

View file

@ -188,7 +188,7 @@ class Annotator(Walk):
data = self._calculation_to_string(path, prop, val, version)
if data is None:
continue
if "type" in data:
if "type" in data or "description" in data:
one_is_calculation = True
datas.append(data)
if one_is_calculation:
@ -221,6 +221,8 @@ class Annotator(Walk):
):
if not isinstance(values, Calculation):
return {"value": values}
if values.description:
return {"description": values.description}
if isinstance(values, JinjaCalculation):
return {
"type": "jinja",

View file

@ -171,7 +171,7 @@ class RougailOutputDoc(Examples):
return True
calculation = child.information.get(f"{hidden_property}_calculation", None)
if calculation and calculation['type'] == 'variable':
if calculation and calculation.get('type') == 'variable':
variable_path, value, condition = calculation["value"]
variable = self.conf.forcepermissive.option(variable_path)
try:
@ -569,6 +569,11 @@ class RougailOutputDoc(Examples):
return self._calculation_to_string(variable, calculation, prop)
def _calculation_to_string(self, child, calculation, prop):
if "description" in calculation:
values = calculation["description"]
if not values.endswith("."):
values += "."
return values
if "type" not in calculation:
return calculation["value"]
if calculation["type"] == "jinja":
@ -665,7 +670,7 @@ class RougailOutputDoc(Examples):
# true_msg = _("depends on an undocumented variable")
else:
if uncalculated and not isinstance(uncalculated, Calculation):
true_msg = _('{0} (from an uncalculated variable)').format(uncalculated)
true_msg = _('{0} (from an undocumented variable)').format(uncalculated)
else:
true_msg = _("depends on an undocumented variable")
if true_msg:

View file

@ -0,0 +1,16 @@
[cols="1a,1a"]
|====
| Variable | Description
|
**var1** +
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `basic` `mandatory` |
A first variable.
|
**var2** +
`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `standard` `mandatory` |
A second variable. +
**Default**: value of a variable!.
|====

View file

@ -0,0 +1,55 @@
{
"var1": {
"type": "variable",
"properties": [
{
"type": "type",
"name": "string"
},
{
"type": "mode",
"name": "basic"
},
{
"type": "property",
"name": "mandatory"
}
],
"paths": [
"var1"
],
"names": [
"var1"
],
"descriptions": [
"A first variable."
]
},
"var2": {
"type": "variable",
"default": "value of a variable!.",
"properties": [
{
"type": "type",
"name": "string"
},
{
"type": "mode",
"name": "standard"
},
{
"type": "property",
"name": "mandatory"
}
],
"paths": [
"var2"
],
"names": [
"var2"
],
"descriptions": [
"A second variable."
]
}
}

View file

@ -0,0 +1,5 @@
| Variable&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | Description&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **var1**<br/>[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `basic` `mandatory` | A first variable. |
| **var2**<br/>[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | A second variable.<br/>**Default**: value of a variable!. |

View file

@ -0,0 +1,9 @@
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
 Variable  ┃ Description  ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
var1 │ A first variable. │
 string   basic   mandatory  │ │
├───────────────────────────────────────┼──────────────────────────────────────┤
var2 │ A second variable. │
 string   standard   mandatory  │ Default: value of a variable!. │
└───────────────────────────────────────┴──────────────────────────────────────┘

View file

@ -0,0 +1 @@
[]

View file

@ -0,0 +1 @@
[]

View file

@ -0,0 +1 @@
["No attribute \"description\" for \"empty\" in \"../../rougail-tests/structures/00_1empty_variable/rougail/00-base.yml\""]

View file

@ -0,0 +1 @@
[]

View file

@ -0,0 +1 @@
[]

View file

@ -0,0 +1 @@
["\"default\" is a calculation for var2 but has no description in \"../../rougail-tests/structures/00_2default_calculated_params_permissive/rougail/00-base.yml\""]

View file

@ -0,0 +1 @@
[]

View file

@ -0,0 +1 @@
[]

View file

@ -0,0 +1 @@
[]

View file

@ -0,0 +1 @@
[]

View file

@ -0,0 +1 @@
[]

View file

@ -0,0 +1 @@
[]

View file

@ -0,0 +1 @@
[]

View file

@ -0,0 +1 @@
[]

View file

@ -0,0 +1 @@
[]

View file

@ -0,0 +1 @@
["No attribute \"description\" for \"family\" in \"../../rougail-tests/structures/00_6choice_variable_link2/rougail/00-base.yml\""]

View file

@ -0,0 +1 @@
[]

View file

@ -0,0 +1 @@
[]

View file

@ -0,0 +1 @@
[]

View file

@ -0,0 +1 @@
[]

View file

@ -0,0 +1 @@
[]

View file

@ -0,0 +1 @@
[]

View file

@ -0,0 +1 @@
[]

View file

@ -0,0 +1 @@
[]

View file

@ -0,0 +1 @@
[]

View file

@ -0,0 +1 @@
[]

View file

@ -0,0 +1 @@
[]

View file

@ -0,0 +1 @@
[]

View file

@ -0,0 +1 @@
[]

View file

@ -0,0 +1 @@
[]

View file

@ -0,0 +1 @@
[]

View file

@ -0,0 +1 @@
[]

View file

@ -0,0 +1 @@
[]

View file

@ -0,0 +1 @@
[]

View file

@ -0,0 +1 @@
[]

View file

@ -0,0 +1 @@
[]

View file

@ -0,0 +1 @@
[]

View file

@ -0,0 +1 @@
[]

View file

@ -0,0 +1 @@
[]

View file

@ -0,0 +1 @@
[]

View file

@ -0,0 +1 @@
[]

View file

@ -0,0 +1 @@
["\"default\" is a calculation for var2 but has no description in \"../../rougail-tests/structures/00_9default_calculation_information_other_variable/rougail/00-base.yml\""]

View file

@ -0,0 +1 @@
["No attribute \"description\" for \"my_variable\" in \"../../rougail-tests/structures/00_9default_calculation_multi_optional/rougail/00-base.yml\"", "No attribute \"description\" for \"my_calculated_variable\" in \"../../rougail-tests/structures/00_9default_calculation_multi_optional/rougail/00-base.yml\""]

View file

@ -0,0 +1 @@
["No attribute \"description\" for \"my_variable\" in \"../../rougail-tests/structures/00_9default_calculation_multi_optional2/rougail/00-base.yml\"", "No attribute \"description\" for \"my_calculated_variable\" in \"../../rougail-tests/structures/00_9default_calculation_multi_optional2/rougail/00-base.yml\""]

View file

@ -0,0 +1 @@
["No attribute \"description\" for \"my_calculated_variable\" in \"../../rougail-tests/structures/00_9default_calculation_optional/rougail/00-base.yml\""]

View file

@ -0,0 +1 @@
["No attribute \"description\" for \"my_variable\" in \"../../rougail-tests/structures/00_9default_calculation_optional_exists/rougail/00-base.yml\"", "No attribute \"description\" for \"my_calculated_variable\" in \"../../rougail-tests/structures/00_9default_calculation_optional_exists/rougail/00-base.yml\""]

View file

@ -0,0 +1 @@
[]

View file

@ -0,0 +1 @@
[]

View file

@ -0,0 +1 @@
[]

View file

@ -0,0 +1 @@
[]

View file

@ -0,0 +1 @@
[]

View file

@ -0,0 +1 @@
[]

View file

@ -0,0 +1 @@
[]

View file

@ -0,0 +1 @@
[]

View file

@ -0,0 +1 @@
[]

View file

@ -0,0 +1 @@
[]

View file

@ -0,0 +1 @@
[]

View file

@ -0,0 +1 @@
[]

View file

@ -0,0 +1 @@
[]

View file

@ -0,0 +1 @@
[]

View file

@ -0,0 +1 @@
[]

View file

@ -0,0 +1 @@
[]

View file

@ -0,0 +1 @@
[]

View file

@ -0,0 +1 @@
["\"default\" is a calculation for var3 but has no description in \"../../rougail-tests/structures/04_1default_calculation_hidden/rougail/00-base.yml\""]

View file

@ -0,0 +1 @@
["\"default\" is a calculation for var3 but has no description in \"../../rougail-tests/structures/04_1default_calculation_hidden_2/rougail/00-base.yml\""]

View file

@ -0,0 +1 @@
["\"default\" is a calculation for var3 but has no description in \"../../rougail-tests/structures/04_1default_calculation_hidden_3/rougail/00-base.yml\""]

View file

@ -0,0 +1 @@
["\"default\" is a calculation for var3 but has no description in \"../../rougail-tests/structures/04_1default_calculation_hidden_4/rougail/00-base.yml\""]

View file

@ -0,0 +1 @@
[]

View file

@ -0,0 +1 @@
[]

View file

@ -0,0 +1 @@
[]

View file

@ -0,0 +1 @@
[]

View file

@ -0,0 +1 @@
[]

View file

@ -0,0 +1 @@
[]

View file

@ -0,0 +1 @@
[]

View file

@ -0,0 +1 @@
[]

View file

@ -0,0 +1 @@
[]

View file

@ -0,0 +1 @@
[]

View file

@ -0,0 +1 @@
[]

View file

@ -0,0 +1 @@
[]

View file

@ -0,0 +1 @@
[]

View file

@ -0,0 +1 @@
[]

View file

@ -0,0 +1 @@
[]

View file

@ -0,0 +1 @@
[]

View file

@ -0,0 +1 @@
["No attribute \"description\" for \"family.var1\" in \"../../rougail-tests/structures/16_2family_redefine_calculation/rougail/00-base.yml\"", "No attribute \"description\" for \"family\" in \"../../rougail-tests/structures/16_2family_redefine_calculation/rougail/00-base.yml\" and \"../../rougail-tests/structures/16_2family_redefine_calculation/rougail/01-base.yml\"", "\"disabled\" is a calculation for family but has no description in \"../../rougail-tests/structures/16_2family_redefine_calculation/rougail/00-base.yml\" and \"../../rougail-tests/structures/16_2family_redefine_calculation/rougail/01-base.yml\""]

View file

@ -0,0 +1 @@
[]

Some files were not shown because too many files have changed in this diff Show more