From 9782bcde95551d5d63b0acb8445dfa17f50c5d2b Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Mon, 25 Nov 2024 09:16:48 +0100 Subject: [PATCH] fix: dynamic variable declare in verion 1.0 has {{ suffix }} --- src/rougail/annotator/family.py | 2 ++ src/rougail/config.py | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/src/rougail/annotator/family.py b/src/rougail/annotator/family.py index 40a6dafa6..049a46e66 100644 --- a/src/rougail/annotator/family.py +++ b/src/rougail/annotator/family.py @@ -129,6 +129,8 @@ class Annotator(Walk): family.dynamic.variable, family.path, ) + if family.version == '1.0' and "{{ suffix }}" in path: + path = path.replace("{{ suffix }}", "{{ identifier }}") self.objectspace.informations.add(family.path, "dynamic_variable", path) def change_modes(self): diff --git a/src/rougail/config.py b/src/rougail/config.py index 9ddcb3a9b..83905d1c5 100644 --- a/src/rougail/config.py +++ b/src/rougail/config.py @@ -26,12 +26,16 @@ You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . """ +from sys import version_info + from pathlib import Path from tiramisu import Config from ruamel.yaml import YAML from .utils import _, load_modules, normalize_family from .convert import RougailConvert +if version_info.major == 3 and version_info.minor: + import rougail.structural_commandline.object_model RENAMED = { "dictionaries_dir": "main_dictionaries", @@ -184,6 +188,7 @@ class FakeRougailConvert(RougailConvert): self.internal_functions = [] self.force_optional = False self.plugins = ["structural_commandline"] + self.user_datas = [] self.add_extra_options = self.add_extra_options