Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 47e762b

Browse files
committed
sync with previous handler changes
use IPythonHandler, avoid self.application
1 parent 27b173a commit 47e762b

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

IPython/frontend/html/notebook/handlers.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -680,49 +680,49 @@ def delete(self, notebook_id):
680680
self.finish()
681681

682682

683-
class NotebookCheckpointsHandler(AuthenticatedHandler):
683+
class NotebookCheckpointsHandler(IPythonHandler):
684684

685685
SUPPORTED_METHODS = ('GET', 'POST')
686686

687687
@web.authenticated
688688
def get(self, notebook_id):
689689
"""get lists checkpoints for a notebook"""
690-
nbm = self.application.notebook_manager
690+
nbm = self.notebook_manager
691691
checkpoints = nbm.list_checkpoints(notebook_id)
692692
data = jsonapi.dumps(checkpoints, default=date_default)
693693
self.finish(data)
694694

695695
@web.authenticated
696696
def post(self, notebook_id):
697697
"""post creates a new checkpoint"""
698-
nbm = self.application.notebook_manager
698+
nbm = self.notebook_manager
699699
checkpoint = nbm.create_checkpoint(notebook_id)
700700
data = jsonapi.dumps(checkpoint, default=date_default)
701+
701702
self.finish(data)
702703

703704

704-
class ModifyNotebookCheckpointsHandler(AuthenticatedHandler):
705+
class ModifyNotebookCheckpointsHandler(IPythonHandler):
705706

706707
SUPPORTED_METHODS = ('POST', 'DELETE')
707708

708709
@web.authenticated
709710
def post(self, notebook_id, checkpoint_id):
710711
"""post restores a notebook from a checkpoint"""
711-
nbm = self.application.notebook_manager
712+
nbm = self.notebook_manager
712713
nbm.restore_checkpoint(notebook_id, checkpoint_id)
713714
self.set_status(204)
714715
self.finish()
715716

716717
@web.authenticated
717718
def delete(self, notebook_id, checkpoint_id):
718719
"""delete clears a checkpoint for a given notebook"""
719-
nbm = self.application.notebook_manager
720+
nbm = self.notebook_manager
720721
nbm.delte_checkpoint(notebook_id, checkpoint_id)
721722
self.set_status(204)
722723
self.finish()
723724

724725

725-
726726
class NotebookCopyHandler(IPythonHandler):
727727

728728
@web.authenticated

0 commit comments

Comments
 (0)