Show More
@@ -47,9 +47,13 def pandoc(source, fmt, to, extra_args=None, encoding='utf-8'): | |||||
47 | command = ['pandoc', '-f', fmt, '-t', to] |
|
47 | command = ['pandoc', '-f', fmt, '-t', to] | |
48 | if extra_args: |
|
48 | if extra_args: | |
49 | command.extend(extra_args) |
|
49 | command.extend(extra_args) | |
|
50 | try: | |||
50 | p = subprocess.Popen(command, |
|
51 | p = subprocess.Popen(command, | |
51 | stdin=subprocess.PIPE, stdout=subprocess.PIPE |
|
52 | stdin=subprocess.PIPE, stdout=subprocess.PIPE | |
52 | ) |
|
53 | ) | |
|
54 | except OSError: | |||
|
55 | sys.exit("ERROR: Unable to launch pandoc. Please install pandoc:\n" | |||
|
56 | "(http://johnmacfarlane.net/pandoc/installing.html)") | |||
53 | out, _ = p.communicate(cast_bytes(source, encoding)) |
|
57 | out, _ = p.communicate(cast_bytes(source, encoding)) | |
54 | out = out.decode(encoding, 'replace') |
|
58 | out = out.decode(encoding, 'replace') | |
55 | return out[:-1] |
|
59 | return out[:-1] |
General Comments 0
You need to be logged in to leave comments.
Login now