This commit is contained in:
egarette@silique.fr 2025-12-29 12:15:56 +01:00
parent 7fadb7f473
commit eac7df5bf5
6 changed files with 95 additions and 19 deletions

20
README.fr.md Normal file
View file

@ -0,0 +1,20 @@
---
gitea: none
include_toc: true
---
[🇬🇧 (EN)](README.md) - [🇫🇷 (FR)](README.fr.md)
## Charger les données utilisateur à partir d'un fichier YAML
> [!NOTE]
>
> **Chemin** : yaml\
> *`désactivé`*\
> **Désactivé** : si yaml n'est pas défini dans "[Sélection pour données utilisateur](#step.user_data)"
| Variable | Description | Valeur par défaut | Type | Validateur |
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------|--------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **<a id="yaml.filename" name="yaml.filename">yaml.filename</a>**<br/>**Ligne de commande** : <br/>-yf, --yaml.filename<br/>**Variable d'environnement** : YAML.FILENAME | Noms de fichiers ou répertoires où sont enregistrés les données utilisateur.<br/>Si un répertoire est défini, tous les fichiers avec l&#x27;extension &quot;yml&quot; ou &quot;yaml&quot; seront chargés dans l&#x27;ordre alphanumérique. | | [`UNIX filename`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `multiple` `obligatoire` | `unique`<br/>&nbsp;le nom de fichier peut être une chemin relatif<br/>&nbsp;le fichier doit exister<br/>&nbsp;type de fichier autorisé: "fichier" et "répertoire". |
| **<a id="yaml.file_with_secrets" name="yaml.file_with_secrets">yaml.file_with_secrets</a>**<br/>**Ligne de commande** : <br/>--yaml.file_with_secrets<br/>**Variable d'environnement** : YAML.FILE_WITH_SECRETS | Le fichier peut contenir des secrets.<br/>Par défaut, tous les fichiers peuvent contenir des secrets. Il peut être intéressant de définir plus précisément quels fichiers peuvent contenir ces secrets. | all | [`choice`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `obligatoire` | **Choix** : <br/>&nbsp;all<br/>&nbsp;first<br/>&nbsp;last<br/>&nbsp;none |

View file

@ -1,2 +1,20 @@
# rougail-user-data-yaml ---
gitea: none
include_toc: true
---
[🇬🇧 (EN)](README.md) - [🇫🇷 (FR)](README.fr.md)
## Charge user data from YAML file
> [!NOTE]
>
> **Path**: yaml\
> *`disabled`*\
> **Disabled**: if yaml is not set in "[Select for user datas](#step.user_data)"
| Variable | Description | Default value | Type | Validator |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------|------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------|
| **<a id="yaml.filename" name="yaml.filename">yaml.filename</a>**<br/>**Command line**: <br/>-yf, --yaml.filename<br/>**Environment variable**: YAML.FILENAME | File or directory names where user data are stored.<br/>If a directory is set, all files with &quot;yml&quot; ou &quot;yaml&quot; extension will be load with alphanum order. | | [`UNIX filename`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `multiple` `mandatory` | `unique`<br/>&nbsp;this filename could be a relative path<br/>&nbsp;this file must exist<br/>&nbsp;file type allowed: "directory" and "file". |
| **<a id="yaml.file_with_secrets" name="yaml.file_with_secrets">yaml.file_with_secrets</a>**<br/>**Command line**: <br/>--yaml.file_with_secrets<br/>**Environment variable**: YAML.FILE_WITH_SECRETS | File that may contain secrets.<br/>By default, all files can contain secrets. It might be useful to define more precisely which files can contain these secrets. | all | [`choice`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` | **Choices**: <br/>&nbsp;all<br/>&nbsp;first<br/>&nbsp;last<br/>&nbsp;none |

View file

@ -5,8 +5,8 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: \n" "Project-Id-Version: \n"
"POT-Creation-Date: 2025-05-14 08:28+0200\n" "POT-Creation-Date: 2025-12-29 12:15+0100\n"
"PO-Revision-Date: 2025-05-14 08:29+0200\n" "PO-Revision-Date: 2025-12-29 12:18+0100\n"
"Last-Translator: \n" "Last-Translator: \n"
"Language-Team: \n" "Language-Team: \n"
"Language: fr\n" "Language: fr\n"
@ -14,13 +14,13 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Generated-By: pygettext.py 1.5\n" "Generated-By: pygettext.py 1.5\n"
"X-Generator: Poedit 3.5\n" "X-Generator: Poedit 3.8\n"
#: src/rougail/user_data_yaml/__init__.py:46 #: src/rougail/user_data_yaml/__init__.py:46
msgid "yaml is not set in step.user_data" msgid "yaml is not set in step.user_data"
msgstr "\"yaml\" n'est pas défini dans step.user_data" msgstr "\"yaml\" n'est pas défini dans step.user_data"
#: src/rougail/user_data_yaml/__init__.py:72 #: src/rougail/user_data_yaml/__init__.py:74
msgid "cannot load \"{0}\", the root value is not a dict but \"{1}\"" msgid "cannot load \"{0}\", the root value is not a dict but \"{1}\""
msgstr "" msgstr ""
"ne peut charger \"{0}\", la valeur racine n'est pas une dictionnaire mais " "ne peut charger \"{0}\", la valeur racine n'est pas une dictionnaire mais "
@ -35,17 +35,41 @@ msgid "\"{0}\" in {1} has an unknown value"
msgstr "\"{0}\" dans {1} a une valeur inconnue" msgstr "\"{0}\" dans {1} a une valeur inconnue"
#: src/rougail/user_data_yaml/config.py:30 #: src/rougail/user_data_yaml/config.py:30
msgid "Configuration rougail-user-data-yaml" msgid "Charge user data from YAML file"
msgstr "Configuration de rougail-user-data-yaml" msgstr "Charger les données utilisateur à partir d'un fichier YAML"
#: src/rougail/user_data_yaml/config.py:35
msgid "if yaml is not set in \"step.user_data\""
msgstr "si yaml n'est pas défini dans \"step.user_data\""
#: src/rougail/user_data_yaml/config.py:38
msgid "File or directory names where user data are stored"
msgstr ""
"Noms de fichiers ou répertoires où sont enregistrés les données utilisateur"
#: src/rougail/user_data_yaml/config.py:39 #: src/rougail/user_data_yaml/config.py:39
msgid "File or directory name where user datas are stored" msgid ""
"If a directory is set, all files with \"yml\" ou \"yaml\" extension will be "
"load with alphanum order."
msgstr "" msgstr ""
"Nom du fichier ou répertoire où sont enregistré les données utilisateur" "Si un répertoire est défini, tous les fichiers avec l'extension \"yml\" ou "
"\"yaml\" seront chargés dans l'ordre alphanumérique."
#: src/rougail/user_data_yaml/config.py:48 #: src/rougail/user_data_yaml/config.py:48
msgid "File that may contain secrets" msgid "File that may contain secrets"
msgstr "Le fichier peut contenir des secrets" msgstr "Le fichier peut contenir des secrets"
#: src/rougail/user_data_yaml/config.py:49
msgid ""
"By default, all files can contain secrets. It might be useful to define more "
"precisely which files can contain these secrets."
msgstr ""
"Par défaut, tous les fichiers peuvent contenir des secrets. Il peut être "
"intéressant de définir plus précisément quels fichiers peuvent contenir ces "
"secrets."
#~ msgid "Configuration rougail-user-data-yaml"
#~ msgstr "Configuration de rougail-user-data-yaml"
#~ msgid "Filename" #~ msgid "Filename"
#~ msgstr "Nom du fichier" #~ msgstr "Nom du fichier"

View file

@ -5,7 +5,7 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2025-05-14 08:29+0200\n" "POT-Creation-Date: 2025-12-29 12:18+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -19,7 +19,7 @@ msgstr ""
msgid "yaml is not set in step.user_data" msgid "yaml is not set in step.user_data"
msgstr "" msgstr ""
#: src/rougail/user_data_yaml/__init__.py:72 #: src/rougail/user_data_yaml/__init__.py:74
msgid "cannot load \"{0}\", the root value is not a dict but \"{1}\"" msgid "cannot load \"{0}\", the root value is not a dict but \"{1}\""
msgstr "" msgstr ""
@ -32,14 +32,26 @@ msgid "\"{0}\" in {1} has an unknown value"
msgstr "" msgstr ""
#: src/rougail/user_data_yaml/config.py:30 #: src/rougail/user_data_yaml/config.py:30
msgid "Configuration rougail-user-data-yaml" msgid "Charge user data from YAML file"
msgstr ""
#: src/rougail/user_data_yaml/config.py:35
msgid "if yaml is not set in \"step.user_data\""
msgstr ""
#: src/rougail/user_data_yaml/config.py:38
msgid "File or directory names where user data are stored"
msgstr "" msgstr ""
#: src/rougail/user_data_yaml/config.py:39 #: src/rougail/user_data_yaml/config.py:39
msgid "File or directory name where user datas are stored" msgid "If a directory is set, all files with \"yml\" ou \"yaml\" extension will be load with alphanum order."
msgstr "" msgstr ""
#: src/rougail/user_data_yaml/config.py:48 #: src/rougail/user_data_yaml/config.py:48
msgid "File that may contain secrets" msgid "File that may contain secrets"
msgstr "" msgstr ""
#: src/rougail/user_data_yaml/config.py:49
msgid "By default, all files can contain secrets. It might be useful to define more precisely which files can contain these secrets."
msgstr ""

View file

@ -27,15 +27,16 @@ def get_rougail_config(
) -> dict: ) -> dict:
options = f""" options = f"""
yaml: yaml:
description: {_("Configuration rougail-user-data-yaml")} description: {_("Charge user data from YAML file")}
disabled: disabled:
jinja: | jinja: >-
{{% if step.user_data is propertyerror or 'yaml' not in step.user_data %}} {{{{ step.user_data is not propertyerror or 'yaml' not in step.user_data }}}}
disabled return_type: boolean
{{% endif %}} description: {_('if yaml is not set in "step.user_data"')}
filename: filename:
description: {_("File or directory name where user datas are stored")} description: {_("File or directory names where user data are stored")}
help: {_('If a directory is set, all files with "yml" ou "yaml" extension will be load with alphanum order.')}
alternative_name: yf alternative_name: yf
type: unix_filename type: unix_filename
multi: true multi: true
@ -45,6 +46,7 @@ yaml:
file_with_secrets: file_with_secrets:
description: {_("File that may contain secrets")} description: {_("File that may contain secrets")}
help: {_('By default, all files can contain secrets. It might be useful to define more precisely which files can contain these secrets.')}
default: all default: all
choices: choices:
- all - all