WIP: Expand the developer documentation #27

Draft
gremond wants to merge 226 commits from develop into developer_docs
24 changed files with 40 additions and 31 deletions
Showing only changes of commit 2f179a2bf6 - Show all commits

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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)
if not self.load_from_tiramisu_cache:
self.converted = RougailConvert(self.rougailconfig, *types) self.converted = RougailConvert(self.rougailconfig, *types)
self.config = None self.config = None
def get_root_option(self): def get_root_option(self):
if not self.load_from_tiramisu_cache:
tiram_obj = self.converted.save() 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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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