def get_notebook_checkpoint(self, checkpoint_id, path):
"""Get the content of a checkpoint for a notebook.
Returns a dict of the form:
{
"type": "notebook",
"content": <output of nbformat.read>,
}
"""
self.log.info("restoring %s from checkpoint %s", path, checkpoint_id)
cp = self._get_checkpoint_path(checkpoint_id, path)
exists, blob = self.parent._fetch(cp)
if not exists:
raise web.HTTPError(404, u"No such checkpoint: %s for %s" % (
checkpoint_id, path))
nb = self.parent._read_notebook(blob)
return {
"type": "notebook",
"content": nb
}
评论列表
文章目录