Compare commits
No commits in common. "ae89e30e60ebbcbcd129215132825698e50e0216" and "1858eeeb06c2d704b5cb0466466d133e55f6b7f9" have entirely different histories.
ae89e30e60
...
1858eeeb06
10 changed files with 5 additions and 46 deletions
13
CHANGELOG.md
13
CHANGELOG.md
|
|
@ -1,16 +1,3 @@
|
||||||
## 1.2.0a15 (2025-04-01)
|
|
||||||
|
|
||||||
### Feat
|
|
||||||
|
|
||||||
- can link regexp variable
|
|
||||||
- can link choice variable
|
|
||||||
|
|
||||||
### Fix
|
|
||||||
|
|
||||||
- update tests
|
|
||||||
- do not raise variable in property with force_optional
|
|
||||||
- update translation
|
|
||||||
|
|
||||||
## 1.2.0a14 (2025-03-30)
|
## 1.2.0a14 (2025-03-30)
|
||||||
|
|
||||||
### Fix
|
### Fix
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ requires = ["flit_core >=3.8.0,<4"]
|
||||||
|
|
||||||
[project]
|
[project]
|
||||||
name = "rougail"
|
name = "rougail"
|
||||||
version = "1.2.0a15"
|
version = "1.2.0a14"
|
||||||
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"
|
||||||
|
|
|
||||||
|
|
@ -589,9 +589,7 @@ class VariablePropertyCalculation(_VariableCalculation):
|
||||||
identifier,
|
identifier,
|
||||||
needs_multi=False,
|
needs_multi=False,
|
||||||
)
|
)
|
||||||
if objectspace.force_optional and (not params[None] or "variable" not in params[None][0]):
|
if params[None] and "variable" in params[None][0]:
|
||||||
params = {None: [None, None, False]}
|
|
||||||
else:
|
|
||||||
variable = params[None][0]["variable"]
|
variable = params[None][0]["variable"]
|
||||||
if self.when is not undefined:
|
if self.when is not undefined:
|
||||||
if self.version == "1.0":
|
if self.version == "1.0":
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,6 @@ from rougail.error import display_xmlfiles
|
||||||
from tiramisu import DynOptionDescription, calc_value, function_waiting_for_error
|
from tiramisu import DynOptionDescription, calc_value, function_waiting_for_error
|
||||||
from tiramisu.error import ValueWarning, ConfigError, PropertiesOptionError, CancelParam
|
from tiramisu.error import ValueWarning, ConfigError, PropertiesOptionError, CancelParam
|
||||||
from .utils import normalize_family
|
from .utils import normalize_family
|
||||||
from .i18n import _
|
|
||||||
|
|
||||||
|
|
||||||
global func
|
global func
|
||||||
|
|
@ -164,7 +163,7 @@ def jinja_to_function(
|
||||||
except Exception as err:
|
except Exception as err:
|
||||||
kw_str = ", ".join(kw_to_string(kw))
|
kw_str = ", ".join(kw_to_string(kw))
|
||||||
raise ConfigError(
|
raise ConfigError(
|
||||||
_('cannot calculating "{0}" attribute for variable "{1}" in {2} with parameters "{3}": {4}').format(__internal_attribute, __internal_variable, display_xmlfiles(__internal_files), kw_str, err)
|
f'cannot calculating "{__internal_attribute}" attribute for variable "{__internal_variable}" in {display_xmlfiles(__internal_files)} with parameters "{kw_str}": {err}'
|
||||||
) from err
|
) from err
|
||||||
convert = CONVERT_OPTION[__internal_type].get("func", str)
|
convert = CONVERT_OPTION[__internal_type].get("func", str)
|
||||||
if __internal_multi:
|
if __internal_multi:
|
||||||
|
|
|
||||||
|
|
@ -1,10 +0,0 @@
|
||||||
{
|
|
||||||
"rougail.var1": {
|
|
||||||
"owner": "default",
|
|
||||||
"value": "#a1a1a1"
|
|
||||||
},
|
|
||||||
"rougail.var2": {
|
|
||||||
"owner": "default",
|
|
||||||
"value": "#a1a1a1"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,4 +0,0 @@
|
||||||
{
|
|
||||||
"rougail.var1": "#a1a1a1",
|
|
||||||
"rougail.var2": "#a1a1a1"
|
|
||||||
}
|
|
||||||
|
|
@ -1,10 +0,0 @@
|
||||||
{
|
|
||||||
"rougail.var1": {
|
|
||||||
"owner": "default",
|
|
||||||
"value": "#a1a1a1"
|
|
||||||
},
|
|
||||||
"rougail.var2": {
|
|
||||||
"owner": "default",
|
|
||||||
"value": "#a1a1a1"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
[]
|
|
||||||
|
|
@ -21,6 +21,6 @@ class Regexp_option_3(RegexpOption):
|
||||||
Regexp_option_3._regexp = re_compile(r"^#(?:[0-9a-f]{3}){1,2}$")
|
Regexp_option_3._regexp = re_compile(r"^#(?:[0-9a-f]{3}){1,2}$")
|
||||||
|
|
||||||
option_2 = Regexp_option_2(name="var1", doc="a first variable", default="#a1a1a1", properties=frozenset({"mandatory", "standard"}), informations={'type': 'regexp', 'test': ('#b1b1b1', '#b2b2b2')})
|
option_2 = Regexp_option_2(name="var1", doc="a first variable", default="#a1a1a1", properties=frozenset({"mandatory", "standard"}), informations={'type': 'regexp', 'test': ('#b1b1b1', '#b2b2b2')})
|
||||||
option_3 = Regexp_option_3(name="var2", doc="a second variable", default=Calculation(func['calc_value'], Params((ParamOption(option_2)))), properties=frozenset({"mandatory", "standard"}), informations={'type': 'regexp', 'test': ('#b2b1b1', '#b3b2b2')})
|
option_3 = Regexp_option_3(name="var2", doc="a second variable", default=Calculation(func['calc_value'], Params((ParamOption(option_2)))), properties=frozenset({"mandatory", "standard"}), informations={'type': 'regexp'})
|
||||||
optiondescription_1 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_2, option_3], properties=frozenset({"standard"}))
|
optiondescription_1 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_2, option_3], properties=frozenset({"standard"}))
|
||||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1])
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1])
|
||||||
|
|
|
||||||
|
|
@ -17,5 +17,5 @@ class Regexp_option_2(RegexpOption):
|
||||||
Regexp_option_2._regexp = re_compile(r"^#(?:[0-9a-f]{3}){1,2}$")
|
Regexp_option_2._regexp = re_compile(r"^#(?:[0-9a-f]{3}){1,2}$")
|
||||||
|
|
||||||
option_1 = Regexp_option_1(name="var1", doc="a first variable", default="#a1a1a1", properties=frozenset({"mandatory", "standard"}), informations={'type': 'regexp', 'test': ('#b1b1b1', '#b2b2b2')})
|
option_1 = Regexp_option_1(name="var1", doc="a first variable", default="#a1a1a1", properties=frozenset({"mandatory", "standard"}), informations={'type': 'regexp', 'test': ('#b1b1b1', '#b2b2b2')})
|
||||||
option_2 = Regexp_option_2(name="var2", doc="a second variable", default=Calculation(func['calc_value'], Params((ParamOption(option_1)))), properties=frozenset({"mandatory", "standard"}), informations={'type': 'regexp', 'test': ('#b2b1b1', '#b3b2b2')})
|
option_2 = Regexp_option_2(name="var2", doc="a second variable", default=Calculation(func['calc_value'], Params((ParamOption(option_1)))), properties=frozenset({"mandatory", "standard"}), informations={'type': 'regexp'})
|
||||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_2])
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_2])
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue