This commit is contained in:
Benjamin Bertrand 2017-04-16 18:47:24 +03:00
parent 122ed72f26
commit 03d660df25

View File

@ -38,7 +38,7 @@ def feed(template, data, output="", force=0):
:param force: Override is the output already exists :param force: Override is the output already exists
""" """
logger.info(f"Getting template {template}") logger.info(f"Getting template {template}")
tpl = texenv.get_template(template) tpl = texenv.get_template(str(template))
if not output: if not output:
num = 1 num = 1
@ -68,20 +68,20 @@ def pdflatex(latex_file, output_dir=""):
If output_dir is not set, it produce it next to the latex file. If output_dir is not set, it produce it next to the latex file.
""" """
if not output_dir: if not output_dir:
output_dir = Path(latex_file).dirname() output_dir = Path(latex_file).dirname().abspath()
compilation = subprocess.Popen( compilation = subprocess.Popen(
[ [
"pdflatex", "pdflatex",
f"-output-directory={output_dir}", f"-output-directory={output_dir}",
latex_file, str(latex_file),
], ],
stdout=subprocess.PIPE, stdout=subprocess.PIPE,
stderr=subprocess.PIPE, stderr=subprocess.PIPE,
# shell=True # shell=True
) )
out, err = compilation.communicate() out, err = compilation.communicate(timeout=5)
if err: if err:
logger.error(err) logger.error(err)
if out: if out: