Refact: move bopytex.bopytex to service.main
This commit is contained in:
@@ -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:
|
||||
|
@@ -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'
|
||||
|
Reference in New Issue
Block a user