File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import importlib .util
22import pathlib
3+ import sys
4+ import types
35
46
57ROOT = pathlib .Path (__file__ ).resolve ().parents [1 ]
68GENERATED = ROOT / "public" / "generated" / "automate_universel.py"
9+ GENERATED_DIR = GENERATED .parent
10+ GRADIENT_MODULE = "dégradés_couleur"
711
812
913def load_core ():
1014 assert GENERATED .exists (), f"generated French core missing: { GENERATED } "
15+ generated_dir = str (GENERATED_DIR )
16+ if generated_dir not in sys .path :
17+ sys .path .insert (0 , generated_dir )
18+ if GRADIENT_MODULE not in sys .modules :
19+ # The generated core currently imports this helper even though the smoke
20+ # tested code paths do not use it.
21+ sys .modules [GRADIENT_MODULE ] = types .ModuleType (GRADIENT_MODULE )
1122 spec = importlib .util .spec_from_file_location ("automate_universel_generated" , GENERATED )
1223 module = importlib .util .module_from_spec (spec )
1324 spec .loader .exec_module (module )
You can’t perform that action at this time.
0 commit comments