Commit 25e92254 authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

Polish build_version.

parent 08370113
......@@ -39,6 +39,7 @@ import sys
from glob import glob
from os.path import join as opj
from subprocess import call, CalledProcessError, check_output
from tempfile import TemporaryFile
# constants
......@@ -180,6 +181,7 @@ def build_pdf(doc):
if not filename:
print "\n\tNo latex file !\n"
os.chdir(cwd)
return
try:
......@@ -188,6 +190,7 @@ def build_pdf(doc):
except CalledProcessError:
print "\n\tFailled to generate PDF file !"
print "\tCheck LaTeX file in", latexdir, "\n"
os.chdir(cwd)
return
check_output(["pdflatex", filename])
......@@ -684,7 +687,8 @@ def which(cmd, localhost=False):
# local host
if not ARGS.force_container or localhost:
try:
out = check_output(["which", cmd])
with TemporaryFile() as fi:
out = check_output(["which", cmd], stderr=fi)
print "\n\tCommand", cmd, "found on the localhost"
return [out.strip("\n")]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment