Compare commits

..

No commits in common. "5ae05434feba7af8d6d0674246482c5e6f52f4ac" and "27350dcab4a840fd11d7de1cb632aa21c62a141f" have entirely different histories.

9 changed files with 94 additions and 105 deletions

View file

@ -1,9 +1,3 @@
## 1.2.0a49 (2025-12-22)
### Fix
- better error message
## 1.2.0a48 (2025-12-22) ## 1.2.0a48 (2025-12-22)
### Fix ### Fix

View file

@ -5,8 +5,8 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: \n" "Project-Id-Version: \n"
"POT-Creation-Date: 2025-12-22 19:02+0100\n" "POT-Creation-Date: 2025-12-22 15:32+0100\n"
"PO-Revision-Date: 2025-12-22 19:04+0100\n" "PO-Revision-Date: 2025-12-22 15:35+0100\n"
"Last-Translator: \n" "Last-Translator: \n"
"Language-Team: \n" "Language-Team: \n"
"Language: fr\n" "Language: fr\n"
@ -980,50 +980,56 @@ msgstr ""
"la famille {0} est {1}, {2} à l'index \"{3}\", elle a été chargée depuis {4}" "la famille {0} est {1}, {2} à l'index \"{3}\", elle a été chargée depuis {4}"
#: src/rougail/user_data.py:421 #: src/rougail/user_data.py:421
msgid "variable has propery {0}, it has been loading from {1}" msgid "variable is {0}, it has been loading from {1}"
msgstr "la variable a la propriété {0}, elle a été chargée depuis {1}" msgstr "la variable est {0}, elle a été chargée depuis {1}"
#: src/rougail/user_data.py:425 #: src/rougail/user_data.py:425
msgid "variable has property {0}, it will be ignored when loading from {1}" msgid "variable is {0}, it will be ignored when loading from {1}"
msgstr "" msgstr "la variable est {0}, elle sera ignorée lors du chargement depuis {1}"
"la variable a la propriété {0}, elle sera ignorée lors du chargement depuis "
"{1}"
#: src/rougail/user_data.py:435 #: src/rougail/user_data.py:435
msgid "" msgid ""
"family {0} has property {1}, so cannot access to {2}, it has been loading " "family {0} is {1}, so cannot access to {2}, it has been loading from {3}"
"from {3}"
msgstr "" msgstr ""
"la famille {0} a la propriété {1}, donc ne peut accéder à {2}, elle a été " "la famille {0} est {1}, donc ne peut accéder à {2}, elle a été chargée "
"chargée depuis {3}" "depuis {3}"
#: src/rougail/user_data.py:439 #: src/rougail/user_data.py:439
msgid "" msgid ""
"family {0} has property {1}, so cannot access to {2}, it will be ignored " "family {0} is {1}, so cannot access to {2}, it will be ignored when loading "
"when loading from {3}" "from {3}"
msgstr "" msgstr ""
"la famille {0} a la propriété {1}, donc ne peut accéder à {2}, sera ignorée " "la famille {0} est {1}, donc ne peut accéder à {2}, sera ignorée lors du "
"lors du chargement depuis {3}" "chargement depuis {3}"
#: src/rougail/user_data.py:459
msgid "{0}, it has been loading from {1}"
msgstr "{0}, elle a été chargée depuis {1}"
#: src/rougail/user_data.py:461 #: src/rougail/user_data.py:461
msgid "{0}, it will be ignored when loading from {1}" msgid ""
msgstr "{0}, elle sera ignorée lors du chargement depuis {1}" "the value \"{0}\" is an invalid {1} for {2} at index \"{3}\", {4}, it has "
"been loading from {5}"
msgstr ""
"la valeur \"{0}\" est un {1} invalide pour {2} à l'index \"{3}\", {4}, elle "
"a été chargée depuis {5}"
#: src/rougail/user_data.py:466 #: src/rougail/user_data.py:465
msgid "the value \"{0}\" is an invalid {1}, {2}" msgid ""
msgstr "la valeur \"{0}\" est un {1} invalide, {2}" "the value \"{0}\" is an invalid {1} for {2} at index \"{3}\", {4}, it will "
"be ignored when loading from {5}"
msgstr ""
"la valeur \"{0}\" est un {1} invalide pour {2} à l'index \"{3}\", {4}, elle "
"sera ignorée lors du chargement depuis {5}"
#: src/rougail/user_data.py:472 #: src/rougail/user_data.py:481
msgid ", it has been loading from {0}" msgid "the value \"{0}\" is an invalid {1}, {2}, it has been loading from {3}"
msgstr ", elle a été chargée depuis {0}" msgstr ""
"la valeur \"{0}\" est un {1} invalide pour {2}, elle a été chargée depuis {3}"
#: src/rougail/user_data.py:474 #: src/rougail/user_data.py:485
msgid ", it will be ignored when loading from {0}" msgid ""
msgstr ", elle sera ignorée lors du chargement depuis {0}" "the value \"{0}\" is an invalid {1}, {2}, it will be ignored when loading "
"from {3}"
msgstr ""
"la valeur \"{0}\" est un {1} invalide pour {2}, elle sera ignorée lors du "
"chargement depuis {3}"
#: src/rougail/utils.py:56 #: src/rougail/utils.py:56
msgid "" msgid ""
@ -1057,32 +1063,6 @@ msgstr "unique"
msgid "auto modified" msgid "auto modified"
msgstr "auto modifiée" msgstr "auto modifiée"
#~ msgid ""
#~ "the value \"{0}\" is an invalid {1} for {2} at index \"{3}\", {4}, it has "
#~ "been loading from {5}"
#~ msgstr ""
#~ "la valeur \"{0}\" est un {1} invalide pour {2} à l'index \"{3}\", {4}, "
#~ "elle a été chargée depuis {5}"
#~ msgid ""
#~ "the value \"{0}\" is an invalid {1} for {2} at index \"{3}\", {4}, it "
#~ "will be ignored when loading from {5}"
#~ msgstr ""
#~ "la valeur \"{0}\" est un {1} invalide pour {2} à l'index \"{3}\", {4}, "
#~ "elle sera ignorée lors du chargement depuis {5}"
#~ msgid ""
#~ "the value \"{0}\" is an invalid {1}, {2}, it has been loading from {3}"
#~ msgstr ""
#~ "la valeur \"{0}\" est un {1} invalide, {2}, elle a été chargée depuis {3}"
#~ msgid ""
#~ "the value \"{0}\" is an invalid {1}, {2}, it will be ignored when loading "
#~ "from {3}"
#~ msgstr ""
#~ "la valeur \"{0}\" est un {1} invalide, {2}, elle sera ignorée lors du "
#~ "chargement depuis {3}"
#~ msgid "The secret pattern to build item name in Bitwarden" #~ msgid "The secret pattern to build item name in Bitwarden"
#~ msgstr "" #~ msgstr ""
#~ "Le patron de secret pour construire le nom de l'élément dans Bitwarden" #~ "Le patron de secret pour construire le nom de l'élément dans Bitwarden"

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-12-22 19:04+0100\n" "POT-Creation-Date: 2025-12-22 15:35+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"
@ -732,39 +732,35 @@ msgid "family {0} is {1}, {2} at index \"{3}\", it will be ignored when loading
msgstr "" msgstr ""
#: src/rougail/user_data.py:421 #: src/rougail/user_data.py:421
msgid "variable has propery {0}, it has been loading from {1}" msgid "variable is {0}, it has been loading from {1}"
msgstr "" msgstr ""
#: src/rougail/user_data.py:425 #: src/rougail/user_data.py:425
msgid "variable has property {0}, it will be ignored when loading from {1}" msgid "variable is {0}, it will be ignored when loading from {1}"
msgstr "" msgstr ""
#: src/rougail/user_data.py:435 #: src/rougail/user_data.py:435
msgid "family {0} has property {1}, so cannot access to {2}, it has been loading from {3}" msgid "family {0} is {1}, so cannot access to {2}, it has been loading from {3}"
msgstr "" msgstr ""
#: src/rougail/user_data.py:439 #: src/rougail/user_data.py:439
msgid "family {0} has property {1}, so cannot access to {2}, it will be ignored when loading from {3}" msgid "family {0} is {1}, so cannot access to {2}, it will be ignored when loading from {3}"
msgstr ""
#: src/rougail/user_data.py:459
msgid "{0}, it has been loading from {1}"
msgstr "" msgstr ""
#: src/rougail/user_data.py:461 #: src/rougail/user_data.py:461
msgid "{0}, it will be ignored when loading from {1}" msgid "the value \"{0}\" is an invalid {1} for {2} at index \"{3}\", {4}, it has been loading from {5}"
msgstr "" msgstr ""
#: src/rougail/user_data.py:466 #: src/rougail/user_data.py:465
msgid "the value \"{0}\" is an invalid {1}, {2}" msgid "the value \"{0}\" is an invalid {1} for {2} at index \"{3}\", {4}, it will be ignored when loading from {5}"
msgstr "" msgstr ""
#: src/rougail/user_data.py:472 #: src/rougail/user_data.py:481
msgid ", it has been loading from {0}" msgid "the value \"{0}\" is an invalid {1}, {2}, it has been loading from {3}"
msgstr "" msgstr ""
#: src/rougail/user_data.py:474 #: src/rougail/user_data.py:485
msgid ", it will be ignored when loading from {0}" msgid "the value \"{0}\" is an invalid {1}, {2}, it will be ignored when loading from {3}"
msgstr "" msgstr ""
#: src/rougail/utils.py:56 #: src/rougail/utils.py:56

View file

@ -1,6 +1,6 @@
[project] [project]
name = "rougail" name = "rougail"
version = "1.2.0a49" version = "1.2.0a48"
[tool.commitizen] [tool.commitizen]
name = "cz_conventional_commits" name = "cz_conventional_commits"

View file

@ -4,7 +4,7 @@ requires = ["flit_core >=3.8.0,<4"]
[project] [project]
name = "rougail-base" name = "rougail-base"
version = "1.2.0a49" version = "1.2.0a48"
authors = [{name = "Emmanuel Garette", email = "gnunux@gnunux.info"}] authors = [{name = "Emmanuel Garette", email = "gnunux@gnunux.info"}]
readme = "README.md" readme = "README.md"
description = "A consistency handling system that was initially designed in the configuration management" description = "A consistency handling system that was initially designed in the configuration management"

View file

@ -4,7 +4,7 @@ requires = ["flit_core >=3.8.0,<4"]
[project] [project]
name = "rougail" name = "rougail"
version = "1.2.0a49" version = "1.2.0a48"
authors = [{name = "Emmanuel Garette", email = "gnunux@gnunux.info"}] authors = [{name = "Emmanuel Garette", email = "gnunux@gnunux.info"}]
description = "A consistency handling system that was initially designed in the configuration management" description = "A consistency handling system that was initially designed in the configuration management"
classifiers = [ classifiers = [
@ -18,7 +18,7 @@ classifiers = [
dependencies = [ dependencies = [
"ruamel.yaml ~= 0.18.6", "ruamel.yaml ~= 0.18.6",
"pydantic ~= 2.9.2", "pydantic ~= 2.9.2",
"rougail-base == 1.2.0a49", "rougail-base == 1.2.0a48",
] ]
[tool.flit.sdist] [tool.flit.sdist]

View file

@ -1 +1 @@
__version__ = "1.2.0a49" __version__ = "1.2.0a48"

View file

@ -419,11 +419,11 @@ class UserData:
if path == err_path: if path == err_path:
if self.invalid_user_data_error: if self.invalid_user_data_error:
msg = _( msg = _(
"variable has propery {0}, it has been loading from {1}" "variable is {0}, it has been loading from {1}"
) )
else: else:
msg = _( msg = _(
"variable has property {0}, it will be ignored when loading from {1}" "variable is {0}, it will be ignored when loading from {1}"
) )
self.unknowns.append({ self.unknowns.append({
msg.format( msg.format(
@ -433,11 +433,11 @@ class UserData:
else: else:
if self.invalid_user_data_error: if self.invalid_user_data_error:
msg = _( msg = _(
"family {0} has property {1}, so cannot access to {2}, it has been loading from {3}" "family {0} is {1}, so cannot access to {2}, it has been loading from {3}"
) )
else: else:
msg = _( msg = _(
"family {0} has property {1}, so cannot access to {2}, it will be ignored when loading from {3}" "family {0} is {1}, so cannot access to {2}, it will be ignored when loading from {3}"
) )
self.unknowns.append({ self.unknowns.append({
msg.format( msg.format(
@ -453,26 +453,46 @@ class UserData:
) )
except LeadershipError as err: except LeadershipError as err:
self.unknowns.append({_("{0} in {1}").format(err, options["source"]): option._subconfig}) self.unknowns.append({_("{0} in {1}").format(err, options["source"]): option._subconfig})
except ConfigError as err:
err.prefix = ""
if self.invalid_user_data_error:
msg = _('{0}, it has been loading from {1}').format(err, options["source"])
else:
msg = _('{0}, it will be ignored when loading from {1}').format(err, options["source"])
self.invalids.append({msg: option._subconfig})
except ValueError as err: except ValueError as err:
err.prefix = "" err.prefix = ""
if index is not None:
type_ = option.type(translation=True) type_ = option.type(translation=True)
msg = _('the value "{0}" is an invalid {1}, {2}').format( if self.invalid_user_data_error:
msg = _(
'the value "{0}" is an invalid {1} for {2} at index "{3}", {4}, it has been loading from {5}'
)
else:
msg = _(
'the value "{0}" is an invalid {1} for {2} at index "{3}", {4}, it will be ignored when loading from {5}'
)
self.invalids.append({
msg.format(
self._display_value(option, value),
type_,
option.description(with_quote=True),
index,
err,
options["source"],
): option._subconfig}
)
else:
type_ = option.type(translation=True)
if self.invalid_user_data_error:
msg = _(
'the value "{0}" is an invalid {1}, {2}, it has been loading from {3}'
)
else:
msg = _(
'the value "{0}" is an invalid {1}, {2}, it will be ignored when loading from {3}'
)
self.invalids.append({
msg.format(
self._display_value(option, value), self._display_value(option, value),
type_, type_,
err, err,
options["source"],
): option._subconfig}
) )
if self.invalid_user_data_error:
msg += _(', it has been loading from {0}').format(options["source"])
else:
msg += _(', it will be ignored when loading from {0}').format(options["source"])
self.invalids.append({msg: option._subconfig})
except AttributeOptionError as err: except AttributeOptionError as err:
if err.code == "option-dynamic": if err.code == "option-dynamic":
continue continue
@ -484,7 +504,6 @@ class UserData:
# it's a function # it's a function
params = tuple([ParamValue(val) for val in value[1:]]) params = tuple([ParamValue(val) for val in value[1:]])
value = Calculation(value[0], Params(params, kwargs={"option": ParamValue(option)})) value = Calculation(value[0], Params(params, kwargs={"option": ParamValue(option)}))
option = self.config.forcepermissive.option(option.path(), option.index())
option.value.set(value) option.value.set(value)