##// END OF EJS Templates
Set orig_nbformat keys when downgrading v4->v3
Min RK -
Show More
@@ -241,9 +241,11 def downgrade(nb):
241 cells = [ downgrade_cell(cell) for cell in nb.pop('cells') ]
241 cells = [ downgrade_cell(cell) for cell in nb.pop('cells') ]
242 nb.worksheets = [v3.new_worksheet(cells=cells)]
242 nb.worksheets = [v3.new_worksheet(cells=cells)]
243 nb.metadata.setdefault('name', '')
243 nb.metadata.setdefault('name', '')
244 nb.metadata.pop('orig_nbformat', None)
245 nb.metadata.pop('orig_nbformat_minor', None)
246
244
247 # Validate the converted notebook before returning it
245 # Validate the converted notebook before returning it
248 _warn_if_invalid(nb, v3.nbformat)
246 _warn_if_invalid(nb, v3.nbformat)
247
248 nb.orig_nbformat = nb.metadata.pop('orig_nbformat', nbformat)
249 nb.orig_nbformat_minor = nb.metadata.pop('orig_nbformat_minor', nbformat_minor)
250
249 return nb
251 return nb
General Comments 0
You need to be logged in to leave comments. Login now