1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-01-19 04:21:17 +00:00

Use notebook format 3 for ipynb_exporter

The file assumes format 3 throughout the code, so explicitly import that
format instead of the generic "current" format.
This commit is contained in:
Javi Merino 2015-04-16 18:21:40 +01:00
parent d31a5c3c48
commit f41be396fa

View File

@ -30,15 +30,15 @@ except ImportError as import_error:
if IPython and (IPython.version_info[0] == 2): if IPython and (IPython.version_info[0] == 2):
import IPython.kernel import IPython.kernel
import IPython.nbformat.current import IPython.nbformat.v3
def read_notebook(notebook_in): def read_notebook(notebook_in):
return IPython.nbformat.current.reads_json(notebook_in) return IPython.nbformat.v3.reads_json(notebook_in)
def write_notebook(notebook, fout): def write_notebook(notebook, fout):
IPython.nbformat.current.write(notebook, fout, 'json') IPython.nbformat.v3.nbjson.JSONWriter().write(notebook, fout)
NotebookNode = IPython.nbformat.current.NotebookNode NotebookNode = IPython.nbformat.v3.NotebookNode
elif IPython: elif IPython:
# Unsupported IPython version # Unsupported IPython version