Show More
@@ -32,10 +32,10 b' def upgrade(nb, from_version=1):' | |||||
32 | ---------- |
|
32 | ---------- | |
33 | nb : NotebookNode |
|
33 | nb : NotebookNode | |
34 | The Python representation of the notebook to convert. |
|
34 | The Python representation of the notebook to convert. | |
35 |
|
|
35 | from_version : int | |
36 |
The |
|
36 | The version of the notebook to convert from. | |
37 | """ |
|
37 | """ | |
38 |
if |
|
38 | if from_version == 1: | |
39 | newnb = new_notebook() |
|
39 | newnb = new_notebook() | |
40 | ws = new_worksheet() |
|
40 | ws = new_worksheet() | |
41 | for cell in nb.cells: |
|
41 | for cell in nb.cells: | |
@@ -47,7 +47,7 b' def upgrade(nb, from_version=1):' | |||||
47 | newnb.worksheets.append(ws) |
|
47 | newnb.worksheets.append(ws) | |
48 | return newnb |
|
48 | return newnb | |
49 | else: |
|
49 | else: | |
50 |
raise ValueError('Cannot convert a notebook from v%s to v2' % |
|
50 | raise ValueError('Cannot convert a notebook from v%s to v2' % from_version) | |
51 |
|
51 | |||
52 |
|
52 | |||
53 | def downgrade(nb): |
|
53 | def downgrade(nb): |
General Comments 0
You need to be logged in to leave comments.
Login now