Fixing :prompt_number property on saving.

More conditional code for saving notebooks in nbformat v4.0.
`prompt_number` is no longer a valid property so it has to be corrected
to be `execution_count` instead.
This commit is contained in:
John Miller 2014-11-20 12:36:24 -06:00
parent 5cdb7ca907
commit b83621299e

View file

@ -989,7 +989,7 @@ prettified text thus be used instead of HTML type."
(loop while ocopy
do (let ((prop (pop ocopy))
(value (pop ocopy)))
(ein:log 'info "Checking property %s for output type %s"
(ein:log 'info "Checking property %s for output type '%s'"
prop otype)
(cond
((equal prop :stream) (progn (push value new-output)
@ -1012,6 +1012,12 @@ prettified text thus be used instead of HTML type."
(push (list new-prop (list value)) new-output)
(push :data new-output)))
((and (equal otype "execute_result")
(equal prop :prompt_number))
(ein:log 'info "SAVE-NOTEBOOK: Fixing prompt_number property.")
(push value new-output)
(push :execution_count new-output))
(t (progn (push value new-output) (push prop new-output)))))
finally return new-output))
renamed-outputs))))