import de tiramisu ou tiramisu3

This commit is contained in:
Emmanuel Garette 2020-08-07 17:17:42 +02:00
parent cdc4013450
commit f07f76a4ef
3 changed files with 14 additions and 4 deletions

View File

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

View File

@ -1,4 +1,7 @@
from tiramisu import DynOptionDescription
try:
from tiramisu import DynOptionDescription
except:
from tiramisu3 import DynOptionDescription
from .utils import normalize_family

View File

@ -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}')",