From cdc4013450a7f6a60a267211e48a08a173d40ac8 Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Wed, 5 Aug 2020 12:17:37 +0200 Subject: [PATCH 1/2] extra dependencies --- tests/test_2_makedict.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/tests/test_2_makedict.py b/tests/test_2_makedict.py index 272a112f..02d43a14 100644 --- a/tests/test_2_makedict.py +++ b/tests/test_2_makedict.py @@ -5,9 +5,6 @@ from os import listdir, mkdir from json import dump, load, dumps, loads from tiramisu import Config -from rougail.xml_compare import xml_compare -from rougail.error import DictConsistencyError -from rougail.config import dtdfilename dico_dirs = 'tests/flattener_dicos' From f07f76a4ef060ddf290881cd8e588e7c023a3d3e Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Fri, 7 Aug 2020 17:17:42 +0200 Subject: [PATCH 2/2] import de tiramisu ou tiramisu3 --- src/rougail/template.py | 8 ++++++-- src/rougail/tiramisu.py | 5 ++++- src/rougail/tiramisureflector.py | 5 ++++- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/rougail/template.py b/src/rougail/template.py index 57a5d3c6..b715e1a9 100644 --- a/src/rougail/template.py +++ b/src/rougail/template.py @@ -15,8 +15,12 @@ from os.path import dirname, join, isfile from Cheetah.Template import Template as ChtTemplate from Cheetah.NameMapper import NotFound as CheetahNotFound -from tiramisu import Config -from tiramisu.error import PropertiesOptionError +try: + from tiramisu import Config + from tiramisu.error import PropertiesOptionError +except: + from tiramisu3 import Config + from tiramisu3.error import PropertiesOptionError from .config import patch_dir, variable_namespace from .error import FileNotFound, TemplateError diff --git a/src/rougail/tiramisu.py b/src/rougail/tiramisu.py index 60a96355..caae09f2 100644 --- a/src/rougail/tiramisu.py +++ b/src/rougail/tiramisu.py @@ -1,4 +1,7 @@ -from tiramisu import DynOptionDescription +try: + from tiramisu import DynOptionDescription +except: + from tiramisu3 import DynOptionDescription from .utils import normalize_family diff --git a/src/rougail/tiramisureflector.py b/src/rougail/tiramisureflector.py index a0d821ad..649c0b0a 100644 --- a/src/rougail/tiramisureflector.py +++ b/src/rougail/tiramisureflector.py @@ -47,7 +47,10 @@ class TiramisuReflector: funcs_path, ): self.storage = ElementStorage() - self.storage.text = ["from tiramisu import *", + self.storage.text = ["try:", + " from tiramisu import *", + "except:", + " from tiramisu3 import *", "from rougail.tiramisu import ConvertDynOptionDescription", "import imp", f"func = imp.load_source('func', '{funcs_path}')",