Compare commits
3 commits
697669bc47
...
7cc9426750
| Author | SHA1 | Date | |
|---|---|---|---|
| 7cc9426750 | |||
| 7cc4efe1af | |||
| dfbcd84a00 |
12 changed files with 160 additions and 7 deletions
|
|
@ -1,3 +1,10 @@
|
||||||
|
## 0.1.0a10 (2025-05-02)
|
||||||
|
|
||||||
|
### Fix
|
||||||
|
|
||||||
|
- do not load use_data with rougail cli
|
||||||
|
- support {{ suffix }} name in 1.1 format version
|
||||||
|
|
||||||
## 0.1.0a9 (2025-04-30)
|
## 0.1.0a9 (2025-04-30)
|
||||||
|
|
||||||
### Feat
|
### Feat
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ requires = ["flit_core >=3.8.0,<4"]
|
||||||
|
|
||||||
[project]
|
[project]
|
||||||
name = "rougail.output_formatter"
|
name = "rougail.output_formatter"
|
||||||
version = "0.1.0a9"
|
version = "0.1.0a10"
|
||||||
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 formatter"
|
description = "Rougail output formatter"
|
||||||
|
|
|
||||||
|
|
@ -448,7 +448,10 @@ class RougailOutputFormatter:
|
||||||
return y
|
return y
|
||||||
name = subpath.pop(0)
|
name = subpath.pop(0)
|
||||||
if name not in y and name.endswith('{{ identifier }}'):
|
if name not in y and name.endswith('{{ identifier }}'):
|
||||||
name = name[:-16]
|
search_name = name[:-16]
|
||||||
|
if search_name not in y:
|
||||||
|
search_name = name.replace("{{ identifier }}", "{{ suffix }}")
|
||||||
|
name = search_name
|
||||||
return _yaml(y[name])
|
return _yaml(y[name])
|
||||||
if self.main_namespace:
|
if self.main_namespace:
|
||||||
subpath = path.split('.')[1:]
|
subpath = path.split('.')[1:]
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
__version__ = "0.1.0a9"
|
__version__ = "0.1.0a10"
|
||||||
|
|
|
||||||
|
|
@ -30,20 +30,35 @@ load_unexist_redefine:
|
||||||
default:
|
default:
|
||||||
jinja: >-
|
jinja: >-
|
||||||
{% if step.output is not propertyerror and step.output == 'formatter' %}
|
{% if step.output is not propertyerror and step.output == 'formatter' %}
|
||||||
true
|
true
|
||||||
{% else %}
|
{% else %}
|
||||||
false
|
false
|
||||||
{% endif %}
|
{% endif %}
|
||||||
hidden:
|
hidden:
|
||||||
jinja: >-
|
jinja: >-
|
||||||
{% if step.output is not propertyerror and step.output == 'formatter' %}
|
{% if step.output is not propertyerror and step.output == 'formatter' %}
|
||||||
load_unexist_redefine is always true with 'formatter' output
|
load_unexist_redefine is always true with 'formatter' output
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
cli:
|
||||||
|
|
||||||
|
load_config:
|
||||||
|
exists: true
|
||||||
|
redefine: true
|
||||||
|
type: boolean
|
||||||
|
default:
|
||||||
|
jinja: >-
|
||||||
|
{% if step.output is not propertyerror and step.output == 'formatter' %}
|
||||||
|
false
|
||||||
|
{% else %}
|
||||||
|
true
|
||||||
|
{% endif %}
|
||||||
"""
|
"""
|
||||||
return {
|
return {
|
||||||
"name": "formatter",
|
"name": "formatter",
|
||||||
"process": "output",
|
"process": "output",
|
||||||
"options": options,
|
"options": options,
|
||||||
|
"allow_user_data": False,
|
||||||
"level": 90,
|
"level": 90,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
%YAML 1.2
|
||||||
|
---
|
||||||
|
version: 1.1
|
||||||
|
|
||||||
|
var1:
|
||||||
|
description: a first variable
|
||||||
|
default: value
|
||||||
|
hidden: true
|
||||||
|
|
||||||
|
var2:
|
||||||
|
description: a second variable
|
||||||
|
disabled:
|
||||||
|
variable: _.var1
|
||||||
|
when: value
|
||||||
|
|
||||||
|
var3:
|
||||||
|
description: a third variable
|
||||||
|
default:
|
||||||
|
jinja: >-
|
||||||
|
{% if _.var1 == 'value' or _.var2 == 'blah' %}
|
||||||
|
value
|
||||||
|
{% endif %}
|
||||||
|
...
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
%YAML 1.2
|
||||||
|
---
|
||||||
|
version: 1.1
|
||||||
|
|
||||||
|
var1:
|
||||||
|
description: a first variable
|
||||||
|
default: value
|
||||||
|
hidden: true
|
||||||
|
|
||||||
|
var2:
|
||||||
|
description: a second variable
|
||||||
|
disabled:
|
||||||
|
variable: _.var1
|
||||||
|
when_not: value
|
||||||
|
|
||||||
|
var3:
|
||||||
|
description: a third variable
|
||||||
|
default:
|
||||||
|
jinja: >-
|
||||||
|
{% if _.var1 == 'value' or _.var2 == 'blah' %}
|
||||||
|
value
|
||||||
|
{% endif %}
|
||||||
|
...
|
||||||
|
|
@ -0,0 +1,18 @@
|
||||||
|
%YAML 1.2
|
||||||
|
---
|
||||||
|
version: 1.1
|
||||||
|
|
||||||
|
var1: value # a first variable
|
||||||
|
|
||||||
|
var2:
|
||||||
|
description: a second variable
|
||||||
|
default:
|
||||||
|
variable: _.var1
|
||||||
|
hidden: true
|
||||||
|
|
||||||
|
var3:
|
||||||
|
description: a third variable
|
||||||
|
disabled:
|
||||||
|
variable: _.var2
|
||||||
|
when: value
|
||||||
|
...
|
||||||
|
|
@ -0,0 +1,18 @@
|
||||||
|
%YAML 1.2
|
||||||
|
---
|
||||||
|
version: 1.1
|
||||||
|
|
||||||
|
var1: value # a first variable
|
||||||
|
|
||||||
|
var2:
|
||||||
|
description: a second variable
|
||||||
|
default:
|
||||||
|
variable: _.var1
|
||||||
|
hidden: true
|
||||||
|
|
||||||
|
var3:
|
||||||
|
description: a third variable
|
||||||
|
disabled:
|
||||||
|
variable: _.var2
|
||||||
|
when_not: value
|
||||||
|
...
|
||||||
22
tests/results/04_5validators_multi3/rougail/00-base.yml
Normal file
22
tests/results/04_5validators_multi3/rougail/00-base.yml
Normal file
|
|
@ -0,0 +1,22 @@
|
||||||
|
%YAML 1.2
|
||||||
|
---
|
||||||
|
version: 1.1
|
||||||
|
|
||||||
|
var1:
|
||||||
|
description: a second variable
|
||||||
|
test:
|
||||||
|
- 0
|
||||||
|
validators:
|
||||||
|
- jinja: |-
|
||||||
|
{% if _.var1 != index %}
|
||||||
|
value != than index
|
||||||
|
{% endif %}
|
||||||
|
description: value must be equal to index
|
||||||
|
params:
|
||||||
|
index:
|
||||||
|
type: index
|
||||||
|
default:
|
||||||
|
- 0
|
||||||
|
- 1
|
||||||
|
- 2
|
||||||
|
...
|
||||||
|
|
@ -0,0 +1,24 @@
|
||||||
|
%YAML 1.2
|
||||||
|
---
|
||||||
|
version: 1.1
|
||||||
|
|
||||||
|
var: # A identifier variable
|
||||||
|
- val1
|
||||||
|
- val2
|
||||||
|
|
||||||
|
'{{ identifier }}':
|
||||||
|
description: A dynamic family
|
||||||
|
dynamic:
|
||||||
|
variable: _.var
|
||||||
|
propertyerror: false
|
||||||
|
allow_none: true
|
||||||
|
|
||||||
|
'{{ identifier }}':
|
||||||
|
description: A dynamic family
|
||||||
|
dynamic:
|
||||||
|
variable: __.var
|
||||||
|
propertyerror: false
|
||||||
|
allow_none: true
|
||||||
|
|
||||||
|
var: # A dynamic variable
|
||||||
|
...
|
||||||
|
|
@ -15,7 +15,7 @@ excludes = [
|
||||||
]
|
]
|
||||||
|
|
||||||
test_ok = get_structures_list(excludes)
|
test_ok = get_structures_list(excludes)
|
||||||
# test_ok = [Path('../rougail-tests/structures/16_3family_empty_at_ends')]
|
# test_ok = [Path('../rougail-tests/structures/60_6family_dynamic_sub_dynamic_1_0_2')]
|
||||||
|
|
||||||
|
|
||||||
def idfn(fixture_value):
|
def idfn(fixture_value):
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue