Compare commits
2 commits
5a6e526d38
...
41a65ef2e5
| Author | SHA1 | Date | |
|---|---|---|---|
| 41a65ef2e5 | |||
| 2f179a2bf6 |
29 changed files with 51 additions and 36 deletions
|
|
@ -1,3 +1,9 @@
|
||||||
|
## 1.2.0a52 (2026-01-03)
|
||||||
|
|
||||||
|
### Feat
|
||||||
|
|
||||||
|
- load tiramisu objects from cache
|
||||||
|
|
||||||
## 1.2.0a51 (2025-12-30)
|
## 1.2.0a51 (2025-12-30)
|
||||||
|
|
||||||
### Feat
|
### Feat
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
[project]
|
[project]
|
||||||
name = "rougail"
|
name = "rougail"
|
||||||
version = "1.2.0a51"
|
version = "1.2.0a52"
|
||||||
|
|
||||||
[tool.commitizen]
|
[tool.commitizen]
|
||||||
name = "cz_conventional_commits"
|
name = "cz_conventional_commits"
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ requires = ["flit_core >=3.8.0,<4"]
|
||||||
|
|
||||||
[project]
|
[project]
|
||||||
name = "rougail-base"
|
name = "rougail-base"
|
||||||
version = "1.2.0a51"
|
version = "1.2.0a52"
|
||||||
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"
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ requires = ["flit_core >=3.8.0,<4"]
|
||||||
|
|
||||||
[project]
|
[project]
|
||||||
name = "rougail"
|
name = "rougail"
|
||||||
version = "1.2.0a51"
|
version = "1.2.0a52"
|
||||||
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.0a51",
|
"rougail-base == 1.2.0a52",
|
||||||
]
|
]
|
||||||
|
|
||||||
[tool.flit.sdist]
|
[tool.flit.sdist]
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ Cadoles (http://www.cadoles.com)
|
||||||
Copyright (C) 2019-2021
|
Copyright (C) 2019-2021
|
||||||
|
|
||||||
Silique (https://www.silique.fr)
|
Silique (https://www.silique.fr)
|
||||||
Copyright (C) 2022-2025
|
Copyright (C) 2022-2026
|
||||||
|
|
||||||
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 +1 @@
|
||||||
__version__ = "1.2.0a51"
|
__version__ = "1.2.0a52"
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ Cadoles (http://www.cadoles.com)
|
||||||
Copyright (C) 2019-2021
|
Copyright (C) 2019-2021
|
||||||
|
|
||||||
Silique (https://www.silique.fr)
|
Silique (https://www.silique.fr)
|
||||||
Copyright (C) 2022-2025
|
Copyright (C) 2022-2026
|
||||||
|
|
||||||
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
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ Cadoles (http://www.cadoles.com)
|
||||||
Copyright (C) 2019-2021
|
Copyright (C) 2019-2021
|
||||||
|
|
||||||
Silique (https://www.silique.fr)
|
Silique (https://www.silique.fr)
|
||||||
Copyright (C) 2022-2025
|
Copyright (C) 2022-2026
|
||||||
|
|
||||||
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
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ Cadoles (http://www.cadoles.com)
|
||||||
Copyright (C) 2019-2021
|
Copyright (C) 2019-2021
|
||||||
|
|
||||||
Silique (https://www.silique.fr)
|
Silique (https://www.silique.fr)
|
||||||
Copyright (C) 2022-2025
|
Copyright (C) 2022-2026
|
||||||
|
|
||||||
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
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ Cadoles (http://www.cadoles.com)
|
||||||
Copyright (C) 2019-2021
|
Copyright (C) 2019-2021
|
||||||
|
|
||||||
Silique (https://www.silique.fr)
|
Silique (https://www.silique.fr)
|
||||||
Copyright (C) 2022-2025
|
Copyright (C) 2022-2026
|
||||||
|
|
||||||
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
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ Cadoles (http://www.cadoles.com)
|
||||||
Copyright (C) 2019-2021
|
Copyright (C) 2019-2021
|
||||||
|
|
||||||
Silique (https://www.silique.fr)
|
Silique (https://www.silique.fr)
|
||||||
Copyright (C) 2022-2025
|
Copyright (C) 2022-2026
|
||||||
|
|
||||||
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
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ Cadoles (http://www.cadoles.com)
|
||||||
Copyright (C) 2019-2021
|
Copyright (C) 2019-2021
|
||||||
|
|
||||||
Silique (https://www.silique.fr)
|
Silique (https://www.silique.fr)
|
||||||
Copyright (C) 2022-2025
|
Copyright (C) 2022-2026
|
||||||
|
|
||||||
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,5 +1,5 @@
|
||||||
"""Silique (https://www.silique.fr)
|
"""Silique (https://www.silique.fr)
|
||||||
Copyright (C) 2022-2025
|
Copyright (C) 2022-2026
|
||||||
|
|
||||||
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
|
||||||
|
|
@ -15,6 +15,7 @@ You should have received a copy of the GNU Lesser General Public License
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
from pathlib import Path
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
from tiramisu import Config
|
from tiramisu import Config
|
||||||
from warnings import warn
|
from warnings import warn
|
||||||
|
|
@ -31,17 +32,25 @@ class Rougail(UserData):
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
rougailconfig=None,
|
rougailconfig: Optional[RougailConfig]=None,
|
||||||
|
load_from_tiramisu_cache: bool=False,
|
||||||
) -> None:
|
) -> None:
|
||||||
if rougailconfig is None:
|
if rougailconfig is None:
|
||||||
rougailconfig = RougailConfig
|
rougailconfig = RougailConfig
|
||||||
self.rougailconfig = rougailconfig
|
self.rougailconfig = rougailconfig
|
||||||
|
self.load_from_tiramisu_cache = load_from_tiramisu_cache and Path(self.rougailconfig["tiramisu_cache"]).is_file()
|
||||||
types = rougail_type(self.rougailconfig)
|
types = rougail_type(self.rougailconfig)
|
||||||
self.converted = RougailConvert(self.rougailconfig, *types)
|
if not self.load_from_tiramisu_cache:
|
||||||
|
self.converted = RougailConvert(self.rougailconfig, *types)
|
||||||
self.config = None
|
self.config = None
|
||||||
|
|
||||||
def get_root_option(self):
|
def get_root_option(self):
|
||||||
tiram_obj = self.converted.save()
|
if not self.load_from_tiramisu_cache:
|
||||||
|
tiram_obj = self.converted.save()
|
||||||
|
else:
|
||||||
|
tiramisu_cache = self.rougailconfig["tiramisu_cache"]
|
||||||
|
with open(tiramisu_cache, "r", encoding="utf-8") as tiramisu:
|
||||||
|
tiram_obj = tiramisu.read()
|
||||||
optiondescription = {}
|
optiondescription = {}
|
||||||
custom_types = {
|
custom_types = {
|
||||||
custom.__name__: custom
|
custom.__name__: custom
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ Cadoles (http://www.cadoles.com)
|
||||||
Copyright (C) 2019-2021
|
Copyright (C) 2019-2021
|
||||||
|
|
||||||
Silique (https://www.silique.fr)
|
Silique (https://www.silique.fr)
|
||||||
Copyright (C) 2022-2025
|
Copyright (C) 2022-2026
|
||||||
|
|
||||||
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
|
||||||
|
|
@ -1194,10 +1194,10 @@ class RougailConvert(ParserVariable):
|
||||||
self.init()
|
self.init()
|
||||||
self.annotate()
|
self.annotate()
|
||||||
self.reflect()
|
self.reflect()
|
||||||
output = self.reflector.get_text() + "\n"
|
tiram_obj = self.reflector.get_text() + "\n"
|
||||||
filename = self.tiramisu_cache
|
filename = self.tiramisu_cache
|
||||||
if filename:
|
if filename:
|
||||||
with open(filename, "w", encoding="utf-8") as tiramisu:
|
with open(filename, "w", encoding="utf-8") as tiramisu:
|
||||||
tiramisu.write(output)
|
tiramisu.write(tiram_obj)
|
||||||
# print(output)
|
# print(tiram_obj)
|
||||||
return output
|
return tiram_obj
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
"""Rougail object model
|
"""Rougail object model
|
||||||
|
|
||||||
Silique (https://www.silique.fr)
|
Silique (https://www.silique.fr)
|
||||||
Copyright (C) 2023-2025
|
Copyright (C) 2023-2026
|
||||||
|
|
||||||
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,5 +1,5 @@
|
||||||
"""
|
"""
|
||||||
Copyright (C) 2024-2025
|
Copyright (C) 2024-2026
|
||||||
|
|
||||||
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
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ Cadoles (http://www.cadoles.com)
|
||||||
Copyright (C) 2019-2021
|
Copyright (C) 2019-2021
|
||||||
|
|
||||||
Silique (https://www.silique.fr)
|
Silique (https://www.silique.fr)
|
||||||
Copyright (C) 2022-2025
|
Copyright (C) 2022-2026
|
||||||
|
|
||||||
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
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ Cadoles (http://www.cadoles.com)
|
||||||
Copyright (C) 2019-2021
|
Copyright (C) 2019-2021
|
||||||
|
|
||||||
Silique (https://www.silique.fr)
|
Silique (https://www.silique.fr)
|
||||||
Copyright (C) 2022-2025
|
Copyright (C) 2022-2026
|
||||||
|
|
||||||
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
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ Cadoles (http://www.cadoles.com)
|
||||||
Copyright (C) 2019-2021
|
Copyright (C) 2019-2021
|
||||||
|
|
||||||
Silique (https://www.silique.fr)
|
Silique (https://www.silique.fr)
|
||||||
Copyright (C) 2022-2025
|
Copyright (C) 2022-2026
|
||||||
|
|
||||||
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,6 +1,6 @@
|
||||||
"""
|
"""
|
||||||
Silique (https://www.silique.fr)
|
Silique (https://www.silique.fr)
|
||||||
Copyright (C) 2024-2025
|
Copyright (C) 2024-2026
|
||||||
|
|
||||||
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,7 +1,7 @@
|
||||||
"""Annotate to add specify attribute for tiramisu-cmdline
|
"""Annotate to add specify attribute for tiramisu-cmdline
|
||||||
|
|
||||||
Silique (https://www.silique.fr)
|
Silique (https://www.silique.fr)
|
||||||
Copyright (C) 2024-2025
|
Copyright (C) 2024-2026
|
||||||
|
|
||||||
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
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
Config file for Rougail-structural_commandline
|
Config file for Rougail-structural_commandline
|
||||||
|
|
||||||
Silique (https://www.silique.fr)
|
Silique (https://www.silique.fr)
|
||||||
Copyright (C) 2024-2025
|
Copyright (C) 2024-2026
|
||||||
|
|
||||||
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,7 +1,7 @@
|
||||||
"""Annotate to add specify attribute for tiramisu-cmdline
|
"""Annotate to add specify attribute for tiramisu-cmdline
|
||||||
|
|
||||||
Silique (https://www.silique.fr)
|
Silique (https://www.silique.fr)
|
||||||
Copyright (C) 2024-2025
|
Copyright (C) 2024-2026
|
||||||
|
|
||||||
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,6 +1,6 @@
|
||||||
"""
|
"""
|
||||||
Silique (https://www.silique.fr)
|
Silique (https://www.silique.fr)
|
||||||
Copyright (C) 2022-2025
|
Copyright (C) 2022-2026
|
||||||
|
|
||||||
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,6 +1,6 @@
|
||||||
"""
|
"""
|
||||||
Silique (https://www.silique.fr)
|
Silique (https://www.silique.fr)
|
||||||
Copyright (C) 2024-2025
|
Copyright (C) 2024-2026
|
||||||
|
|
||||||
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
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ Cadoles (http://www.cadoles.com)
|
||||||
Copyright (C) 2019-2021
|
Copyright (C) 2019-2021
|
||||||
|
|
||||||
Silique (https://www.silique.fr)
|
Silique (https://www.silique.fr)
|
||||||
Copyright (C) 2022-2025
|
Copyright (C) 2022-2026
|
||||||
|
|
||||||
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,6 +1,6 @@
|
||||||
"""
|
"""
|
||||||
Silique (https://www.silique.fr)
|
Silique (https://www.silique.fr)
|
||||||
Copyright (C) 2025
|
Copyright (C) 2025-2026
|
||||||
|
|
||||||
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,6 +1,6 @@
|
||||||
"""
|
"""
|
||||||
Silique (https://www.silique.fr)
|
Silique (https://www.silique.fr)
|
||||||
Copyright (C) 2022-2025
|
Copyright (C) 2022-2026
|
||||||
|
|
||||||
distribued with GPL-2 or later license
|
distribued with GPL-2 or later license
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ Cadoles (http://www.cadoles.com)
|
||||||
Copyright (C) 2019-2021
|
Copyright (C) 2019-2021
|
||||||
|
|
||||||
Silique (https://www.silique.fr)
|
Silique (https://www.silique.fr)
|
||||||
Copyright (C) 2022-2025
|
Copyright (C) 2022-2026
|
||||||
|
|
||||||
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
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue