##// END OF EJS Templates
log fatal error when PDF conversion fails...
MinRK -
Show More
@@ -30,7 +30,7 b' class PDFPostProcessor(PostProcessorBase):'
30 How many times pdflatex will be called.
30 How many times pdflatex will be called.
31 """)
31 """)
32
32
33 command = List(["pdflatex", "--interaction=batchmode", "{filename}"], config=True, help="""
33 command = List(["pdflatex", "{filename}"], config=True, help="""
34 Shell command used to compile PDF.""")
34 Shell command used to compile PDF.""")
35
35
36 verbose = Bool(False, config=True, help="""
36 verbose = Bool(False, config=True, help="""
@@ -43,9 +43,16 b' class PDFPostProcessor(PostProcessorBase):'
43 See files.py for more...
43 See files.py for more...
44 """
44 """
45 command = [c.format(filename=input) for c in self.command]
45 command = [c.format(filename=input) for c in self.command]
46 self.log.info("Building PDF: `%s`", ' '.join(command))
46 self.log.info("Building PDF: %s", command)
47 with open(os.devnull, 'wb') as null:
47 with open(os.devnull, 'rb') as null:
48 stdout = null if not self.verbose else None
48 stdout = subprocess.PIPE if not self.verbose else None
49 for index in range(self.iteration_count):
49 for index in range(self.iteration_count):
50 p = subprocess.Popen(command, stdout=stdout)
50 p = subprocess.Popen(command, stdout=stdout, stdin=null)
51 p.wait()
51 out, err = p.communicate()
52 if p.returncode:
53 if self.verbose:
54 out = u''
55 else:
56 out = out.decode('utf-8', 'replace')
57 self.log.critical(u"PDF conversion failed: %s\n%s", command, out)
58 return
General Comments 0
You need to be logged in to leave comments. Login now