Compare commits
No commits in common. "develop" and "main" have entirely different histories.
16 changed files with 16 additions and 214 deletions
11
CHANGELOG.md
11
CHANGELOG.md
|
@ -1,11 +0,0 @@
|
||||||
## 0.1.0a0 (2025-02-10)
|
|
||||||
|
|
||||||
### Feat
|
|
||||||
|
|
||||||
- output return status too
|
|
||||||
|
|
||||||
## 0.0.1a0 (2025-01-04)
|
|
||||||
|
|
||||||
### Fix
|
|
||||||
|
|
||||||
- remove prefix_path
|
|
|
@ -1,6 +1,6 @@
|
||||||
"""
|
"""
|
||||||
Silique (https://www.silique.fr)
|
Silique (https://www.silique.fr)
|
||||||
Copyright (C) 2024-2025
|
Copyright (C) 2024
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify it
|
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
|
under the terms of the GNU Lesser General Public License as published by the
|
||||||
|
@ -107,12 +107,10 @@ class RougailOutputFormatter:
|
||||||
with BytesIO() as ymlfh:
|
with BytesIO() as ymlfh:
|
||||||
self.yaml.dump(self.families[None], ymlfh)
|
self.yaml.dump(self.families[None], ymlfh)
|
||||||
ret = ymlfh.getvalue().decode("utf-8").strip() + '\n'
|
ret = ymlfh.getvalue().decode("utf-8").strip() + '\n'
|
||||||
return True, ret
|
return ret
|
||||||
|
|
||||||
def print(self):
|
def print(self):
|
||||||
ret, data = self.run()
|
print(self.run())
|
||||||
print(data)
|
|
||||||
return ret
|
|
||||||
|
|
||||||
def parse(self):
|
def parse(self):
|
||||||
# FIXME path to relative !
|
# FIXME path to relative !
|
||||||
|
@ -161,7 +159,7 @@ class RougailOutputFormatter:
|
||||||
else:
|
else:
|
||||||
attributes = self.families_attributes
|
attributes = self.families_attributes
|
||||||
for attr, default_value in attributes.items():
|
for attr, default_value in attributes.items():
|
||||||
if attr in ["name", "path", "namespace", "version", "xmlfiles"]:
|
if attr in ["name", "path", "namespace", "version", "path_prefix", "xmlfiles"]:
|
||||||
continue
|
continue
|
||||||
try:
|
try:
|
||||||
value = getattr(obj, attr)
|
value = getattr(obj, attr)
|
||||||
|
@ -206,7 +204,7 @@ class RougailOutputFormatter:
|
||||||
multi = obj.multi or isinstance(obj.default, list)
|
multi = obj.multi or isinstance(obj.default, list)
|
||||||
type_ = obj.type
|
type_ = obj.type
|
||||||
for attr, default_value in self.variables_attributes.items():
|
for attr, default_value in self.variables_attributes.items():
|
||||||
if attr in ["name", "path", "namespace", "version", "xmlfiles"]:
|
if attr in ["name", "path", "namespace", "version", "path_prefix", "xmlfiles"]:
|
||||||
continue
|
continue
|
||||||
try:
|
try:
|
||||||
value = getattr(obj, attr)
|
value = getattr(obj, attr)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
"""
|
"""
|
||||||
Silique (https://www.silique.fr)
|
Silique (https://www.silique.fr)
|
||||||
Copyright (C) 2024-2025
|
Copyright (C) 2024
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify it
|
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
|
under the terms of the GNU Lesser General Public License as published by the
|
||||||
|
|
|
@ -4,7 +4,7 @@ Cadoles (http://www.cadoles.com)
|
||||||
Copyright (C) 2021
|
Copyright (C) 2021
|
||||||
|
|
||||||
Silique (https://www.silique.fr)
|
Silique (https://www.silique.fr)
|
||||||
Copyright (C) 2022-2025
|
Copyright (C) 2022-2024
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify it
|
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
|
under the terms of the GNU Lesser General Public License as published by the
|
||||||
|
|
|
@ -1,11 +0,0 @@
|
||||||
---
|
|
||||||
version: 1.1
|
|
||||||
|
|
||||||
secret1:
|
|
||||||
description: the first variable
|
|
||||||
type: secret
|
|
||||||
|
|
||||||
secret2:
|
|
||||||
description: the second variable
|
|
||||||
type: secret
|
|
||||||
default: value
|
|
|
@ -1,24 +0,0 @@
|
||||||
---
|
|
||||||
version: 1.1
|
|
||||||
|
|
||||||
condition: no # a conditional variable
|
|
||||||
|
|
||||||
variable1:
|
|
||||||
description: a first variable
|
|
||||||
multi: true
|
|
||||||
disabled:
|
|
||||||
jinja: |-
|
|
||||||
{% if _.condition == "yes" %}
|
|
||||||
condition is yes
|
|
||||||
{% endif %}
|
|
||||||
description: if condition is egal to "yes"
|
|
||||||
|
|
||||||
variable2:
|
|
||||||
description: a second variable
|
|
||||||
multi: true
|
|
||||||
disabled:
|
|
||||||
jinja: |-
|
|
||||||
{% if _.condition == "yes" %}
|
|
||||||
condition is yes
|
|
||||||
{% endif %}
|
|
||||||
description: if condition is egal to "yes"
|
|
|
@ -1,10 +0,0 @@
|
||||||
---
|
|
||||||
version: 1.1
|
|
||||||
|
|
||||||
condition: false # a condition
|
|
||||||
|
|
||||||
variable:
|
|
||||||
description: a variable
|
|
||||||
multi: true
|
|
||||||
disabled:
|
|
||||||
variable: _.condition
|
|
|
@ -1,7 +0,0 @@
|
||||||
---
|
|
||||||
version: 1.1
|
|
||||||
|
|
||||||
family:
|
|
||||||
exists: true
|
|
||||||
|
|
||||||
variable:
|
|
|
@ -1,36 +1,27 @@
|
||||||
---
|
---
|
||||||
version: 1.1
|
version: 1.1
|
||||||
|
|
||||||
var1: # first variable
|
var1: # a variable
|
||||||
|
|
||||||
family: # a family
|
family: # a family
|
||||||
|
|
||||||
var2:
|
var2: # a second variable
|
||||||
description: a second variable
|
|
||||||
test:
|
|
||||||
- string6
|
|
||||||
|
|
||||||
subfamily: # a sub family
|
subfamily: # a sub family
|
||||||
|
|
||||||
variable: # third variable
|
variable: # a variable
|
||||||
- variable: ___.var1
|
- variable: ___.var1
|
||||||
- variable: __.var2
|
- variable: __.var2
|
||||||
|
|
||||||
family2: # a family
|
family2: # a family
|
||||||
|
|
||||||
var2:
|
var2:
|
||||||
description: a variable2
|
|
||||||
default:
|
default:
|
||||||
variable: __.family.var2
|
variable: __.family.var2
|
||||||
|
|
||||||
var3:
|
|
||||||
test:
|
|
||||||
- string5
|
|
||||||
default: string4
|
|
||||||
|
|
||||||
subfamily: # a sub family
|
subfamily: # a sub family
|
||||||
|
|
||||||
variable: # fourth variable
|
variable: # a variable
|
||||||
- variable: ___.var1
|
- variable: ___.var1
|
||||||
- variable: ___.family.var2
|
- variable: ___.family.var2
|
||||||
- variable: __.var3
|
- variable: __.var2
|
||||||
|
|
|
@ -1,22 +0,0 @@
|
||||||
---
|
|
||||||
version: 1.1
|
|
||||||
|
|
||||||
leader:
|
|
||||||
description: a leadership
|
|
||||||
type: leadership
|
|
||||||
|
|
||||||
leader: # a leader
|
|
||||||
- value1
|
|
||||||
- value2
|
|
||||||
|
|
||||||
follower1: val11 # a follower
|
|
||||||
|
|
||||||
follower2: val21 # an other follower
|
|
||||||
|
|
||||||
calculate:
|
|
||||||
description: a calculated variable
|
|
||||||
multi: true
|
|
||||||
default:
|
|
||||||
jinja: |-
|
|
||||||
{{ _.leader.follower1[0] }}
|
|
||||||
unique: false
|
|
|
@ -1,22 +0,0 @@
|
||||||
---
|
|
||||||
version: 1.1
|
|
||||||
|
|
||||||
leader:
|
|
||||||
description: a leadership
|
|
||||||
type: leadership
|
|
||||||
|
|
||||||
leader: # a leader
|
|
||||||
- value1
|
|
||||||
- value2
|
|
||||||
|
|
||||||
follower1: val11 # a follower
|
|
||||||
|
|
||||||
follower2: val21 # an other follower
|
|
||||||
|
|
||||||
calculate:
|
|
||||||
description: a calculated variable
|
|
||||||
multi: true
|
|
||||||
default:
|
|
||||||
jinja: |-
|
|
||||||
{{ _.leader.follower1[-1] }}
|
|
||||||
unique: false
|
|
|
@ -1,21 +0,0 @@
|
||||||
---
|
|
||||||
version: 1.1
|
|
||||||
|
|
||||||
leader:
|
|
||||||
description: a leadership
|
|
||||||
type: leadership
|
|
||||||
|
|
||||||
leader: # a leader
|
|
||||||
- value1
|
|
||||||
- value2
|
|
||||||
|
|
||||||
follower1: val11 # a follower
|
|
||||||
|
|
||||||
follower2: val21 # an other follower
|
|
||||||
|
|
||||||
calculate:
|
|
||||||
description: a calculated variable
|
|
||||||
multi: true
|
|
||||||
default:
|
|
||||||
variable: _.leader.follower1
|
|
||||||
unique: false
|
|
|
@ -1,20 +0,0 @@
|
||||||
---
|
|
||||||
version: 1.1
|
|
||||||
|
|
||||||
leader:
|
|
||||||
description: a leadership
|
|
||||||
type: leadership
|
|
||||||
|
|
||||||
leader: # a leader
|
|
||||||
- value1
|
|
||||||
- value2
|
|
||||||
|
|
||||||
follower1: val11 # a follower
|
|
||||||
|
|
||||||
follower2: val21 # an other follower
|
|
||||||
|
|
||||||
calculate:
|
|
||||||
description: a calculated variable
|
|
||||||
default:
|
|
||||||
jinja: >-
|
|
||||||
{{ _.leader.leader[0] }}
|
|
|
@ -1,20 +0,0 @@
|
||||||
---
|
|
||||||
version: 1.1
|
|
||||||
|
|
||||||
leader:
|
|
||||||
description: a leadership
|
|
||||||
type: leadership
|
|
||||||
|
|
||||||
leader: # a leader
|
|
||||||
- value1
|
|
||||||
- value2
|
|
||||||
|
|
||||||
follower1: val11 # a follower
|
|
||||||
|
|
||||||
follower2: val21 # an other follower
|
|
||||||
|
|
||||||
calculate:
|
|
||||||
description: a calculated variable
|
|
||||||
default:
|
|
||||||
jinja: >-
|
|
||||||
{{ _.leader.leader[-1] }}
|
|
|
@ -1,19 +0,0 @@
|
||||||
---
|
|
||||||
version: 1.1
|
|
||||||
|
|
||||||
leader:
|
|
||||||
description: a leadership
|
|
||||||
type: leadership
|
|
||||||
|
|
||||||
leader: # a leader
|
|
||||||
- value1
|
|
||||||
- value2
|
|
||||||
|
|
||||||
follower1: val11 # a follower
|
|
||||||
|
|
||||||
follower2: val21 # an other follower
|
|
||||||
|
|
||||||
calculate:
|
|
||||||
description: a calculated variable
|
|
||||||
default:
|
|
||||||
variable: _.leader.leader
|
|
|
@ -7,11 +7,11 @@ from rougail_tests.utils import get_structures_list, get_rougail_config, config_
|
||||||
|
|
||||||
|
|
||||||
excludes = [
|
excludes = [
|
||||||
# "16_6exists_family",
|
# "24_0family_hidden_condition_sub_family",
|
||||||
]
|
]
|
||||||
|
|
||||||
test_ok = get_structures_list(excludes)
|
test_ok = get_structures_list(excludes)
|
||||||
# test_ok = [Path('../rougail-tests/structures/16_6exists_family')]
|
# test_ok = [Path('../rougail-tests/structures/20_9family_absolute')]
|
||||||
|
|
||||||
|
|
||||||
def idfn(fixture_value):
|
def idfn(fixture_value):
|
||||||
|
@ -32,7 +32,7 @@ def _test_structural_files(file_name, namespace, rougailconfig):
|
||||||
rougailconfig['step.output'] = 'formatter'
|
rougailconfig['step.output'] = 'formatter'
|
||||||
##################################
|
##################################
|
||||||
config = None
|
config = None
|
||||||
generated_output = RougailOutput(config, rougailconfig=rougailconfig).run()[1]
|
generated_output = RougailOutput(config, rougailconfig=rougailconfig).run()
|
||||||
output_file = get_output_director(namespace) / file_name.parent.parent.name / file_name.parent.name / file_name.name
|
output_file = get_output_director(namespace) / file_name.parent.parent.name / file_name.parent.name / file_name.name
|
||||||
if not output_file.is_file():
|
if not output_file.is_file():
|
||||||
if not output_file.parent.is_dir():
|
if not output_file.parent.is_dir():
|
||||||
|
|
Loading…
Reference in a new issue