1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-02-20 20:09:11 +00:00

ipython: rename IPYTHON_NBCONVERT to IPYTHON_NBCONVERT_PDF

This command is tailored for converting notebooks to pdf, but we also
want it to be able to generate html.
This commit is contained in:
Javi Merino 2015-07-09 11:08:15 +01:00
parent a72ae92ece
commit 539c3de7b8

View File

@ -46,7 +46,7 @@ if IPython:
NotebookNode = IPython.nbformat.NotebookNode # pylint: disable=E1101
IPYTHON_NBCONVERT = ['ipython', 'nbconvert', '--to=pdf']
IPYTHON_NBCONVERT_PDF = ['ipython', 'nbconvert', '--to=pdf']
elif StrictVersion(IPython.__version__) >= StrictVersion('2.0.0'):
import IPython.kernel
import IPython.nbformat.v3
@ -59,7 +59,8 @@ if IPython:
NotebookNode = IPython.nbformat.v3.NotebookNode # pylint: disable=E1101
IPYTHON_NBCONVERT = ['ipython', 'nbconvert', '--to=latex', '--post=PDF']
IPYTHON_NBCONVERT_PDF = ['ipython', 'nbconvert', '--to=latex',
'--post=PDF']
else:
# Unsupported IPython version
import_error_str = 'Unsupported IPython version {}'.format(IPython.__version__)
@ -154,7 +155,7 @@ def generate_pdf(nbbasename, output_directory):
os.chdir(output_directory)
with open(os.devnull, 'w') as devnull:
subprocess.check_call(IPYTHON_NBCONVERT + [nbbasename], stderr=devnull)
subprocess.check_call(IPYTHON_NBCONVERT_PDF + [nbbasename], stderr=devnull)
os.chdir(prev_dir)