Compare commits

..

No commits in common. "9d15c4fcb0006a9c98171de3668a53cd1baeb3d4" and "b2ed0c9d29a208a94c45c1d5cd1365275b18311d" have entirely different histories.

7 changed files with 59 additions and 129 deletions

View file

@ -1,9 +1,3 @@
## 0.2.0a3 (2025-02-17)
### Fix
- translation
## 0.2.0a2 (2025-02-10) ## 0.2.0a2 (2025-02-10)
### Feat ### Feat

View file

@ -5,8 +5,8 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: \n" "Project-Id-Version: \n"
"POT-Creation-Date: 2025-02-15 12:43+0100\n" "POT-Creation-Date: 2024-11-01 11:03+0100\n"
"PO-Revision-Date: 2025-02-15 12:44+0100\n" "PO-Revision-Date: 2024-11-01 11:04+0100\n"
"Last-Translator: \n" "Last-Translator: \n"
"Language-Team: \n" "Language-Team: \n"
"Language: fr\n" "Language: fr\n"
@ -16,80 +16,42 @@ msgstr ""
"Generated-By: pygettext.py 1.5\n" "Generated-By: pygettext.py 1.5\n"
"X-Generator: Poedit 3.5\n" "X-Generator: Poedit 3.5\n"
#: src/rougail/output_ansible/__init__.py:57 #: src/rougail/output_exporter/__init__.py:73
msgid "no namespace configured" msgid "The following variables are mandatory but have no value:"
msgstr "aucun espace de nom configuré" msgstr "Les variables suivantes sont obligatoire mais n'ont pas de valeur :"
#: src/rougail/output_ansible/__init__.py:65 #: src/rougail/output_exporter/__init__.py:84
msgid "cannot find host namespace \"{0}\"" msgid "The following variables are inaccessible but are empty and mandatory :"
msgstr "ne peut trouve l'espace de nom de l'hôte \"{0}\"" msgstr "Les variables suiveuses sont inaccessibles mais sont vides et obligatoires :"
#: src/rougail/output_ansible/__init__.py:70 #: src/rougail/output_exporter/output/console.py:53
#, fuzzy msgid "Undocumented variable"
msgid "malformated host namespace \"{0}\", should have the \"hostnames\" key" msgstr "Variable non documentée"
msgstr ""
"l'espace de nom de l'hôte \"{0}\" est mal formaté, devrait avoir la clé "
"\"hostnames\""
#: src/rougail/output_ansible/__init__.py:97 #: src/rougail/output_exporter/output/console.py:54
msgid "cannot find \"hostnames\" in \"{0}\" namespace" msgid "Undocumented but modified variable"
msgstr "ne peut trouve \"hostnames\" dans l'espace de nom \"{0}\"" msgstr "Variable non documentée mais modifiée"
#: src/rougail/output_ansible/config.py:29 #: src/rougail/output_exporter/output/console.py:57
#: src/rougail/output_ansible/config.py:30 msgid "Unmodifiable variable"
msgid "parameter added only to be compatible with Ansible" msgstr "Variable non modifiable"
msgstr "paramètre ajouté seulement pour être compatible avec Ansible"
#: src/rougail/output_ansible/config.py:52 #: src/rougail/output_exporter/output/console.py:61
msgid "Configuration of user data or output Ansible" msgid "Default value"
msgstr "Configuration de Ansible comme donnée utilisateur ou sortie" msgstr "Valeur par défaut"
#: src/rougail/output_ansible/config.py:62 #: src/rougail/output_exporter/output/console.py:62
msgid "Configuration of output Ansible" msgid "Modified value"
msgstr "Configuration de la sortie Ansible" msgstr "Valeur modifiée"
#: src/rougail/output_ansible/config.py:72 #: src/rougail/output_exporter/output/console.py:63
msgid "Namespace with host values" msgid "Original default value"
msgstr "Espace de nom avec les valeurs de l'hôte" msgstr "Valeur par défaut d'origine"
#: src/rougail/output_ansible/config.py:76 #: src/rougail/output_exporter/output/console.py:67
msgid "Only variables in host namespace is available by a host" msgid "Caption"
msgstr "" msgstr "Légende"
"Seules les variables de l'espace de nom de l'hôte est valable pour un hôte"
#: src/rougail/output_ansible/config.py:77 #: src/rougail/output_exporter/output/console.py:92
msgid "All variables is available for all hosts" msgid "Variables:"
msgstr "Tous les variables sont valables pour tous les hôtes" msgstr "Variables :"
#~ msgid "The following variables are mandatory but have no value:"
#~ msgstr "Les variables suivantes sont obligatoire mais n'ont pas de valeur :"
#~ msgid ""
#~ "The following variables are inaccessible but are empty and mandatory :"
#~ msgstr ""
#~ "Les variables suiveuses sont inaccessibles mais sont vides et "
#~ "obligatoires :"
#~ msgid "Undocumented variable"
#~ msgstr "Variable non documentée"
#~ msgid "Undocumented but modified variable"
#~ msgstr "Variable non documentée mais modifiée"
#~ msgid "Unmodifiable variable"
#~ msgstr "Variable non modifiable"
#~ msgid "Default value"
#~ msgstr "Valeur par défaut"
#~ msgid "Modified value"
#~ msgstr "Valeur modifiée"
#~ msgid "Original default value"
#~ msgstr "Valeur par défaut d'origine"
#~ msgid "Caption"
#~ msgstr "Légende"
#~ msgid "Variables:"
#~ msgstr "Variables :"

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-02-15 12:44+0100\n" "POT-Creation-Date: 2024-12-29 10:03+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"
@ -15,44 +15,19 @@ msgstr ""
"Generated-By: pygettext.py 1.5\n" "Generated-By: pygettext.py 1.5\n"
#: src/rougail/output_ansible/__init__.py:57 #: src/rougail/output_ansible/__init__.py:55
msgid "no namespace configured" msgid "no namespace configured"
msgstr "" msgstr ""
#: src/rougail/output_ansible/__init__.py:65 #: src/rougail/output_ansible/__init__.py:63
msgid "cannot find host namespace \"{0}\"" msgid "cannot find hosts namespace \"{0}\""
msgstr "" msgstr ""
#: src/rougail/output_ansible/__init__.py:70 #: src/rougail/output_ansible/__init__.py:68
msgid "malformated host namespace \"{0}\", should have the \"hostnames\" key" msgid "malformated hosts namespace \"{0}\", should has \"hostnames\""
msgstr "" msgstr ""
#: src/rougail/output_ansible/__init__.py:97 #: src/rougail/output_ansible/__init__.py:95
msgid "cannot find \"hostnames\" in \"{0}\" namespace" msgid "cannot find \"hostnames\" in \"{0}\" namespace"
msgstr "" msgstr ""
#: src/rougail/output_ansible/config.py:29
#: src/rougail/output_ansible/config.py:30
msgid "parameter added only to be compatible with Ansible"
msgstr ""
#: src/rougail/output_ansible/config.py:52
msgid "Configuration of user data or output Ansible"
msgstr ""
#: src/rougail/output_ansible/config.py:62
msgid "Configuration of output Ansible"
msgstr ""
#: src/rougail/output_ansible/config.py:72
msgid "Namespace with host values"
msgstr ""
#: src/rougail/output_ansible/config.py:76
msgid "Only variables in host namespace is available by a host"
msgstr ""
#: src/rougail/output_ansible/config.py:77
msgid "All variables is available for all hosts"
msgstr ""

View file

@ -4,7 +4,7 @@ requires = ["flit_core >=3.8.0,<4"]
[project] [project]
name = "rougail.output_ansible" name = "rougail.output_ansible"
version = "0.2.0a3" version = "0.2.0a2"
authors = [{name = "Emmanuel Garette", email = "gnunux@gnunux.info"}] authors = [{name = "Emmanuel Garette", email = "gnunux@gnunux.info"}]
readme = "README.md" readme = "README.md"
description = "Rougail output ansible" description = "Rougail output ansible"

View file

@ -62,12 +62,12 @@ class RougailOutputAnsible(RougailOutputJson):
except AttributeError: except AttributeError:
hosts_config = None hosts_config = None
if not hosts_config: if not hosts_config:
self.errors.append(_('cannot find host namespace "{0}"').format(self.host_namespace)) self.errors.append(_('cannot find hosts namespace "{0}"').format(self.host_namespace))
else: else:
try: try:
hosts_config.option('hostnames').name() hosts_config.option('hostnames').name()
except AttributeError: except AttributeError:
self.errors.append(_('malformated host namespace "{0}", should have the "hostnames" key').format(self.host_namespace)) self.errors.append(_('malformated hosts namespace "{0}", should has "hostnames"').format(self.host_namespace))
return super().manage_errors() return super().manage_errors()
return True return True

View file

@ -16,7 +16,6 @@ You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
""" """
from .i18n import _
from pathlib import Path from pathlib import Path
@ -24,57 +23,57 @@ def get_rougail_config(
*, *,
backward_compatibility=True, backward_compatibility=True,
) -> dict: ) -> dict:
options = [f""" options = ["""
list: list:
description: {_('parameter added only to be compatible with Ansible')} description: parameter added only to be compatible with Ansible
negative_description: {_('parameter added only to be compatible with Ansible')} negative_description: parameter added only to be compatible with Ansible
default: false default: false
disabled: disabled:
type: jinja type: jinja
jinja: | jinja: |
{{% if step.output != 'ansible' %}} {% if step.output != 'ansible' %}
disabled disabled
{{% endif %}} {% endif %}
json: json:
redefine: true redefine: true
disabled: disabled:
type: jinja type: jinja
jinja: | jinja: |
{{% if step.output != 'json' and step.output != 'ansible' %}} {% if step.output != 'json' and step.output != 'ansible' %}
disabled disabled
{{% endif %}} {% endif %}
""", f""" """, """
ansible: ansible:
exists: true exists: true
redefine: true redefine: true
description: {_('Configuration of user data or output Ansible')} description: Configuration of user data or output Ansible
disabled: disabled:
type: jinja type: jinja
jinja: | jinja: |
{{% if step.output != 'ansible' and 'ansible' not in step.user_data %}} {% if step.output != 'ansible' and 'ansible' not in step.user_data %}
disabled disabled
{{% endif %}} {% endif %}
""", f""" """, """
ansible: ansible:
description: {_('Configuration of output Ansible')} description: Configuration of output Ansible
exists: false exists: false
disabled: disabled:
variable: step.output variable: step.output
when_not: ansible when_not: ansible
""", f""" """, """
ansible: ansible:
host_namespace: host_namespace:
description: {_('Namespace with host values')} description: Namespace with host values
default: "hosts" default: "hosts"
namespace_is_hostname: namespace_is_hostname:
description: {_('Only variables in host namespace is available by a host')} description: Only variables in hostname namespace is available by a host
negative_description: {_('All variables is available for all hosts')} negative_description: All variables is available for all hosts
default: false default: false
"""] """]
return { return {