Bopytex/bopytex/worker/compile.py

27 lines
671 B
Python
Raw Permalink Normal View History

2022-04-10 14:27:12 +00:00
import subprocess
2022-04-13 20:14:27 +00:00
from bopytex.message import Message
2022-07-28 07:39:51 +00:00
2022-04-13 10:26:04 +00:00
from ..message import SubprocessMessage
2022-04-10 14:27:12 +00:00
2022-05-07 14:55:33 +00:00
def curstomtex(command: str, options: str):
def func(args: dict, deps, output) -> Message:
compile_process = subprocess.Popen(
[command, options, deps[0]],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
universal_newlines=True,
)
return Message(
compile_process.wait(),
list(compile_process.stdout),
list(compile_process.stderr),
)
2022-04-10 14:27:12 +00:00
2022-05-07 14:55:33 +00:00
return func
latexmk = curstomtex("latexmk", "-f")
pdflatex = curstomtex("pdflatex", "--interaction=nonstopmode")