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 |
|
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: |
|
46 | self.log.info("Building PDF: %s", command) | |
47 |
with open(os.devnull, ' |
|
47 | with open(os.devnull, 'rb') as null: | |
48 |
stdout = |
|
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. |
|
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