refact: remove output to tasks
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
""" Produce tasks to do
|
||||
|
||||
It essentially place things at the right place and define the way that files are named.
|
||||
It essentially place things at the right place.
|
||||
|
||||
"""
|
||||
from dataclasses import dataclass
|
||||
@@ -11,7 +11,6 @@ class Task:
|
||||
action: str
|
||||
args: dict
|
||||
deps: list
|
||||
output: str
|
||||
|
||||
|
||||
def generate(template: str, meta: dict):
|
||||
@@ -20,7 +19,6 @@ def generate(template: str, meta: dict):
|
||||
action="GENERATE",
|
||||
args=meta,
|
||||
deps=[template],
|
||||
output=meta["subject"] + template[3:],
|
||||
)
|
||||
|
||||
|
||||
@@ -30,7 +28,6 @@ def activate_corr_on(src: str):
|
||||
action="ACTIVATE_CORR",
|
||||
args={},
|
||||
deps=[src],
|
||||
output="corr_" + src,
|
||||
)
|
||||
|
||||
|
||||
@@ -40,7 +37,6 @@ def compile_pdf(src: str):
|
||||
action="COMPILE",
|
||||
args={},
|
||||
deps=[src],
|
||||
output=src[:-3] + "pdf"
|
||||
)
|
||||
|
||||
def join_pdfs(pdfs: list):
|
||||
@@ -49,7 +45,6 @@ def join_pdfs(pdfs: list):
|
||||
action="JOIN",
|
||||
args={},
|
||||
deps=pdfs,
|
||||
output="joined.pdf"
|
||||
)
|
||||
|
||||
|
||||
@@ -59,5 +54,4 @@ def clean(files: list):
|
||||
action="CLEAN",
|
||||
args={},
|
||||
deps=files,
|
||||
output=None
|
||||
)
|
||||
|
@@ -25,5 +25,6 @@ class Scheduler:
|
||||
|
||||
def __next__(self):
|
||||
task = self._tasks.pop()
|
||||
self._done.append(task.output)
|
||||
return self.dispatch(task)
|
||||
ans = self.dispatch(task)
|
||||
self._done.append(ans)
|
||||
return ans
|
||||
|
Reference in New Issue
Block a user