From e52b6eb06496dc8732a589c119e60c75f24a7282 Mon Sep 17 00:00:00 2001 From: Bertrand Benjamin Date: Sat, 9 Apr 2022 21:53:00 +0200 Subject: [PATCH] refact: rename bopytex to service --- bopytex/script.py | 9 ++++++--- bopytex/{bopytex.py => service.py} | 6 ++++-- test/{test_bopytex.py => test_service.py} | 3 ++- 3 files changed, 12 insertions(+), 6 deletions(-) rename bopytex/{bopytex.py => service.py} (96%) rename test/{test_bopytex.py => test_service.py} (92%) diff --git a/bopytex/script.py b/bopytex/script.py index d4747e6..ee50405 100644 --- a/bopytex/script.py +++ b/bopytex/script.py @@ -4,9 +4,8 @@ import click import logging -from pathlib import Path -from bopytex.bopytex import bopytex +from bopytex.service import bopytex formatter = logging.Formatter("%(name)s :: %(levelname)s :: %(message)s") steam_handler = logging.StreamHandler() @@ -38,7 +37,11 @@ logger.addHandler(steam_handler) help="CSV containing list of students names", ) @click.option( - "-d", "--dirty", is_flag=True, default=False, help="Do not clean after compilation", + "-d", + "--dirty", + is_flag=True, + default=False, + help="Do not clean after compilation", ) @click.option( "-n", diff --git a/bopytex/bopytex.py b/bopytex/service.py similarity index 96% rename from bopytex/bopytex.py rename to bopytex/service.py index ab96156..77ec753 100755 --- a/bopytex/bopytex.py +++ b/bopytex/service.py @@ -75,10 +75,12 @@ def bopytex( ) tasks = planner(template, subjects, corr, no_join, no_pdf) - scheduler = Scheduler(actions, [template]) + + scheduler = Scheduler([template]) scheduler.append(tasks) - scheduler.run() + for _ in scheduler.backlog: + pass # ----------------------------- diff --git a/test/test_bopytex.py b/test/test_service.py similarity index 92% rename from test/test_bopytex.py rename to test/test_service.py index a752b8e..d8303c5 100644 --- a/test/test_bopytex.py +++ b/test/test_service.py @@ -1,4 +1,4 @@ -from bopytex.bopytex import build_subject_list_from_infos, build_subject_list_from_qty +from bopytex.service import build_subject_list_from_infos, build_subject_list_from_qty def test_build_subject_list_from_qty(): @@ -28,5 +28,6 @@ def test_build_subject_list_from_infos(): {"name": "test2", "date": "tomorow", "number": "2"}, ] + def test_bopytex(): pass