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

Factor out ipython nbconvert in ipynb_exporter results processor

ipython nbconvert CLI changes between ipython 2 and 3, so keep the
string separate so that we can update when we add ipython version 3 support.
This commit is contained in:
Javi Merino 2015-04-16 19:17:51 +01:00
parent f54bb0981f
commit 3bf04735c1

View File

@ -40,6 +40,8 @@ if IPython and (IPython.version_info[0] == 2):
NotebookNode = IPython.nbformat.v3.NotebookNode
IPYTHON_NBCONVERT = ['ipython', 'nbconvert', '--to=latex', '--post=PDF']
elif IPython:
# Unsupported IPython version
IPython_ver_str = ".".join([str(n) for n in IPython.version_info])
@ -120,11 +122,8 @@ def generate_pdf(nbbasename, output_directory):
prev_dir = os.getcwd()
os.chdir(output_directory)
ipython_nbconvert = ['ipython', 'nbconvert', '--to=latex', '--post=PDF',
nbbasename]
with open(os.devnull, 'w') as devnull:
subprocess.check_call(ipython_nbconvert, stderr=devnull)
subprocess.check_call(IPYTHON_NBCONVERT + [nbbasename], stderr=devnull)
os.chdir(prev_dir)