Compare commits

..

No commits in common. "main" and "0.2.0a20" have entirely different histories.

11 changed files with 237 additions and 125 deletions

View file

@ -1,46 +1,153 @@
## 1.0.0 (2026-06-21)
## 0.2.0a20 (2026-06-11)
### Feat
- leadership => sequence
## 0.2.0a19 (2026-05-04)
### Feat
- remove mandatory verification
## 0.2.0a18 (2026-01-21)
### Fix
- warnings and errors support
## 0.2.0a17 (2026-01-14)
### Fix
- remove json.get which is conflict with cli.root feature
## 0.2.0a16 (2025-12-30)
### Feat
- add doc
### Fix
- update tests
## 0.2.0a15 (2025-12-22)
### Fix
- add namespace parameter for ansible
- better namespace support
## 0.2.0a14 (2025-11-21)
### Fix
- ExtentionError => ExtensionError
## 0.2.0a13 (2025-11-06)
### Feat
- add some tests
## 0.2.0a12 (2025-11-03)
### Feat
- allow extra kwargs
### Fix
- update tests
## 0.2.0a11 (2025-10-10)
### Fix
- update test
- tests
- tests for formatter
## 0.2.0a10 (2025-09-29)
### Feat
- remove json.read_write option
- default value for a calculated variable with an unknown optional variable
- update tests for integer type
## 0.2.0a9 (2025-09-22)
### Fix
- dependency
## 0.2.0a8 (2025-05-12)
### Fix
- black
## 0.2.0a7 (2025-04-30)
### Fix
- remove negative_description support
- update tests
## 0.2.0a6 (2025-04-09)
### Fix
- version
## 0.2.0a5 (2025-04-01)
### Fix
- update tests
- update translation
## 0.2.0a4 (2025-03-30)
### Fix
- update tests
## 0.2.0a3 (2025-03-19)
### Feat
- add json.get to have sub variables
## 0.2.0a2 (2025-02-17)
### Fix
- translation
## 0.2.0a1 (2025-02-10)
### Feat
- output return status too
## 0.2.0a0 (2024-12-11)
### Feat
- add error and warnings informations in json
- add tests
### Fix
- rougail dependencies
- update translation
- black
- update tests
- warnings and errors support
- remove json.get which is conflict with cli.root feature
- update tests
- add namespace parameter for ansible
- better namespace support
- ExtentionError => ExtensionError
- update tests
- update test
- tests
- tests for formatter
- dependency
- black
- remove negative_description support
- update tests
- version
- update tests
- update translation
- update tests
- translation
- update tests
## 0.1.1a0 (2024-11-28)
### Fix
- separation between run and print function
## 0.1.0 (2024-11-28)

View file

@ -5,8 +5,8 @@
msgid ""
msgstr ""
"Project-Id-Version: \n"
"POT-Creation-Date: 2026-06-21 18:26+0200\n"
"PO-Revision-Date: 2026-06-21 18:27+0200\n"
"POT-Creation-Date: 2025-12-24 09:33+0100\n"
"PO-Revision-Date: 2025-12-24 09:33+0100\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: fr\n"
@ -14,49 +14,70 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: pygettext.py 1.5\n"
"X-Generator: Poedit 3.9\n"
"X-Generator: Poedit 3.8\n"
#: src/rougail/output_json/__init__.py:51
#: src/rougail/output_json/__init__.py:50
msgid "the \"step.output\" is not set to \"{0}\""
msgstr "\"step.output\" n'est pas mis à \"{0}\""
#: src/rougail/output_json/__init__.py:108
#: src/rougail/output_json/__init__.py:120
msgid "{0}: {1}"
msgstr "{0} : {1}"
#: src/rougail/output_json/__init__.py:111
msgid "Error in config: {0}"
msgstr "Erreur dans la configuration : {0}"
#~ msgid "Error in config: {0}"
#~ msgstr "Erreur dans la configuration : {0}"
#: src/rougail/output_json/__init__.py:121
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 mandatory but have no value:"
#~ msgstr "Les variables suivantes sont obligatoire mais n'ont pas de valeur :"
#: src/rougail/output_json/__init__.py:131
msgid "The following variables are inaccessible but are empty and mandatory :"
msgstr ""
"Les variables suivantes sont inaccessibles mais sont vides et obligatoires :"
#~ msgid "The following variables are inaccessible but are empty and mandatory :"
#~ msgstr "Les variables suivantes sont inaccessibles mais sont vides et obligatoires :"
#: src/rougail/output_json/config.py:29
msgid "Export configuration to JSON format"
msgstr "Export de la configuration au format JSON"
#~ msgid "Export configuration to JSON format"
#~ msgstr "Export de la configuration au format JSON"
#: src/rougail/output_json/config.py:31
msgid ""
"Exporting the configuration in JSON format makes it easier to process the "
"configuration in an external tool, for example."
msgstr ""
"Exporter la configuration au format JSON permet de traiter plus facilement "
"la configuration dans un outil exterieur par exemple."
#~ msgid "Exporting the configuration in JSON format makes it easier to process the configuration in an external tool, for example."
#~ msgstr "Exporter la configuration au format JSON permet de traiter plus facilement la configuration dans un outil exterieur par exemple."
#: src/rougail/output_json/config.py:36
msgid "if json is not set in \"step.output\""
msgstr "si json n'est pas présent dans \"step.output\""
#~ msgid "if json is not set in \"step.output\""
#~ msgstr "si json n'est pas présent dans \"step.output\""
#: src/rougail/output_json/config.py:39
msgid "test mandatories variables before display in JSON"
msgstr "tester les variables obligatoires avant de l'afficher en JSON"
#~ msgid "test mandatories variables before display in JSON"
#~ msgstr "tester les variables obligatoires avant de l'afficher en JSON"
#: src/rougail/output_json/config.py:41
msgid ""
"The configuration must be valid before exporting the data to JSON format. "
"It's better to validate the values at the beginning of the process."
msgstr ""
"La configuration doit être valide avant d'exporter les données au format "
"JSON. C'est mieux de valider les valeurs en début du processus."
#~ msgid "The configuration must be valid before exporting the data to JSON format. It's better to validate the values at the beginning of the process."
#~ msgstr "La configuration doit être valide avant d'exporter les données au format JSON. C'est mieux de valider les valeurs en début du processus."
#: src/rougail/output_json/config.py:46
msgid "true if \"cli.read_write\" is false"
msgstr "true si \"cli.read_write\" est false"
#~ msgid "true if \"cli.read_write\" is false"
#~ msgstr "true si \"cli.read_write\" est false"
#: src/rougail/output_json/config.py:49
msgid "get value for a variable or a family"
msgstr "récupère la valeur pour une variable ou une famille"
#~ msgid "get value for a variable or a family"
#~ msgstr "récupère la valeur pour une variable ou une famille"
#~ msgid "By default, the entire configuration is exported as JSON. It is possible to retrieve variables values from a defined family or directly the value of a variable."
#~ msgstr "Par défaut toute la configuration est exporté en JSON. Il est possible de récupérer les valeurs de variables dans une famille défini ou directement la valeur d'une variable."
#: src/rougail/output_json/config.py:51
msgid ""
"By default, the entire configuration is exported as JSON. It is possible to "
"retrieve variables values from a defined family or directly the value of a "
"variable."
msgstr ""
"Par défaut toute la configuration est exporté en JSON. Il est possible de "
"récupérer les valeurs de variables dans une famille défini ou directement "
"la valeur d'une variable."
#~ msgid "configuration rougail-json"
#~ msgstr "configuration de rougail-json"
@ -68,7 +89,8 @@ msgstr "{0} : {1}"
#~ msgstr "affiche les variables valables en mode lecture seul"
#~ msgid "do not test mandatories variables before display in json"
#~ msgstr "ne pas tester les variables obligatoires avant de l'afficher en json"
#~ msgstr ""
#~ "ne pas tester les variables obligatoires avant de l'afficher en json"
#~ msgid "Undocumented variable"
#~ msgstr "Variable non documentée"

View file

@ -5,7 +5,7 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2026-06-21 18:28+0200\n"
"POT-Creation-Date: 2025-12-24 09:33+0100\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"
@ -15,12 +15,51 @@ msgstr ""
"Generated-By: pygettext.py 1.5\n"
#: src/rougail/output_json/__init__.py:51
#: src/rougail/output_json/__init__.py:50
msgid "the \"step.output\" is not set to \"{0}\""
msgstr ""
#: src/rougail/output_json/__init__.py:108
#: src/rougail/output_json/__init__.py:120
msgid "{0}: {1}"
#: src/rougail/output_json/__init__.py:111
msgid "Error in config: {0}"
msgstr ""
#: src/rougail/output_json/__init__.py:121
msgid "The following variables are mandatory but have no value:"
msgstr ""
#: src/rougail/output_json/__init__.py:131
msgid "The following variables are inaccessible but are empty and mandatory :"
msgstr ""
#: src/rougail/output_json/config.py:29
msgid "Export configuration to JSON format"
msgstr ""
#: src/rougail/output_json/config.py:31
msgid "Exporting the configuration in JSON format makes it easier to process the configuration in an external tool, for example."
msgstr ""
#: src/rougail/output_json/config.py:36
msgid "if json is not set in \"step.output\""
msgstr ""
#: src/rougail/output_json/config.py:39
msgid "test mandatories variables before display in JSON"
msgstr ""
#: src/rougail/output_json/config.py:41
msgid "The configuration must be valid before exporting the data to JSON format. It's better to validate the values at the beginning of the process."
msgstr ""
#: src/rougail/output_json/config.py:46
msgid "true if \"cli.read_write\" is false"
msgstr ""
#: src/rougail/output_json/config.py:49
msgid "get value for a variable or a family"
msgstr ""
#: src/rougail/output_json/config.py:51
msgid "By default, the entire configuration is exported as JSON. It is possible to retrieve variables values from a defined family or directly the value of a variable."
msgstr ""

View file

@ -4,7 +4,7 @@ requires = ["flit_core >=3.8.0,<4"]
[project]
name = "rougail.output_json"
version = "1.0.0"
version = "0.2.0a20"
authors = [{name = "Emmanuel Garette", email = "gnunux@gnunux.info"}]
readme = "README.md"
description = "Rougail output json"
@ -23,7 +23,7 @@ classifiers = [
]
dependencies = [
"rougail-base >= 1.2.0,<2",
"rougail-base >= 1.1,<2",
]
[project.urls]

View file

@ -1,7 +1,7 @@
"""
Silique (https://www.silique.fr)
Copyright (C) 2022-2026
This program is free software: you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published by the
Free Software Foundation, either version 3 of the License, or (at your
@ -105,7 +105,7 @@ class RougailOutputJson:
for w in self.warnings:
if isinstance(w, dict):
msg, opt = next(iter(w.items()))
warnings.append(_("{0}: {1}").format(opt.path, msg))
warnings.append(_('{0}: {1}').format(opt.path, msg))
else:
warnings.append(w)
self.dico["_warnings"] = warnings
@ -117,11 +117,11 @@ class RougailOutputJson:
for e in self.errors:
if isinstance(e, dict):
msg, opt = next(iter(e.items()))
errors.append(_("{0}: {1}").format(opt.path, msg))
errors.append(_('{0}: {1}').format(opt.path, msg))
else:
errors.append(e)
self.dico["_errors"] = errors
# self.manage_warnings()
#self.manage_warnings()
return False
def parse_family(
@ -139,11 +139,7 @@ class RougailOutputJson:
parent,
)
else:
if (
namespace is None
and self.support_namespace
and option.group_type() is groups.namespace
):
if namespace is None and self.support_namespace and option.group_type() is groups.namespace:
subnamespace = option.name()
else:
subnamespace = namespace

View file

@ -1 +1 @@
__version__ = "1.0.0"
__version__ = "0.2.0a20"

View file

@ -1,12 +0,0 @@
{
"var": [
"val1",
"val2"
],
"dynval1": {
"variable": "string1"
},
"dynval2": {
"variable": "string1"
}
}

View file

@ -1,14 +0,0 @@
{
"rougail": {
"var": [
"val1",
"val2"
],
"dynval1": {
"variable": "string1"
},
"dynval2": {
"variable": "string1"
}
}
}

View file

@ -1,14 +0,0 @@
{
"rougail": {
"var": [
"val1",
"val2"
],
"dynval1": {
"variable": null
},
"dynval2": {
"variable": null
}
}
}

View file

@ -1,12 +0,0 @@
{
"var": [
"val1",
"val2"
],
"dynval1": {
"variable": null
},
"dynval2": {
"variable": null
}
}