Refact: move bopytex.bopytex to service.main

This commit is contained in:
2022-05-04 21:16:27 +02:00
parent 467135abc6
commit 0d614465f0
3 changed files with 16 additions and 4 deletions

View File

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

View File

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