Bopytex/bopytex/service.py

41 lines
844 B
Python
Raw Normal View History

2013-09-27 18:09:38 +00:00
#!/usr/bin/env python
# encoding: utf-8
2017-04-16 08:36:27 +00:00
"""
Producing then compiling templates
"""
2022-04-09 14:18:56 +00:00
from bopytex.scheduler import Scheduler
import bopytex.default_config as DEFAULT
2022-04-10 04:45:10 +00:00
def orcherstrator(
options: dict,
planner,
dispatcher,
):
2022-04-10 04:45:10 +00:00
tasks = planner(options)
2022-04-09 14:18:56 +00:00
scheduler = Scheduler(dispatcher, [options["template"]])
2022-04-09 14:18:56 +00:00
scheduler.append(tasks)
for message in scheduler.backlog():
yield message
2014-01-19 20:37:46 +00:00
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
2017-04-16 08:36:27 +00:00
2013-09-27 18:09:38 +00:00
# -----------------------------
# Reglages pour 'vim'
# vim:set autoindent expandtab tabstop=4 shiftwidth=4:
2017-04-16 08:36:27 +00:00
# cursor: 16 del