diff --git a/bopytex/script.py b/bopytex/script.py index 3d1bdaf..afad745 100644 --- a/bopytex/script.py +++ b/bopytex/script.py @@ -5,7 +5,7 @@ import click import logging -from bopytex.bopytex import bopytex +from bopytex.service import main formatter = logging.Formatter("%(name)s :: %(levelname)s :: %(message)s") steam_handler = logging.StreamHandler() @@ -78,7 +78,7 @@ logger.addHandler(steam_handler) help="Create and compile correction while making subjects", ) def new(**options): - for message in bopytex(**options): + for message in main(**options): try: assert message.status == 0 except AssertionError: diff --git a/bopytex/service.py b/bopytex/service.py index 4e1a429..9446fd7 100755 --- a/bopytex/service.py +++ b/bopytex/service.py @@ -6,6 +6,7 @@ Producing then compiling templates """ from bopytex.scheduler import Scheduler +import bopytex.default_config as DEFAULT def orcherstrator( @@ -21,6 +22,17 @@ def orcherstrator( for message in scheduler.backlog(): yield message +def main(**options): + + config = options.copy() + config["jinja2"] = {} + config["jinja2"]["environment"] = DEFAULT.jinja2_env + + orcherstre = orcherstrator( + config, planner=DEFAULT.planner, dispatcher=DEFAULT.dispatcher + ) + for message in orcherstre: + yield message # ----------------------------- # Reglages pour 'vim' diff --git a/test/test_e2e.py b/test/test_e2e.py index 0a0a609..2945c63 100644 --- a/test/test_e2e.py +++ b/test/test_e2e.py @@ -1,7 +1,7 @@ import os import jinja2 from pathlib import Path -from bopytex.bopytex import bopytex +from bopytex.service import main import pytest @@ -43,7 +43,7 @@ def test_with_default_planner(template_path, jinja2_env, tmp_path): }, } - for message in bopytex(**options): + for message in main(**options): pass assert Path("joined_source.pdf").exists()