##// END OF EJS Templates
Merge pull request #3949 from minrk/log-pdf-failure...
Min RK -
r12079:6727e39c merge
parent child Browse files
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,18 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 # verbose means I didn't capture stdout with PIPE,
55 # so it's already been displayed and `out` is None.
56 out = u''
57 else:
58 out = out.decode('utf-8', 'replace')
59 self.log.critical(u"PDF conversion failed: %s\n%s", command, out)
60 return
General Comments 0
You need to be logged in to leave comments. Login now