mirror of
https://github.com/jupyter/notebook.git
synced 2025-02-17 12:39:54 +08:00
indent code block
This commit is contained in:
parent
ceaf1c1158
commit
b644d7ee40
@ -225,25 +225,25 @@ return for a more complete implementation.
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
class NoOpCheckpoints(GenericCheckpointsMixin, Checkpoints):
|
||||
"""requires the following methods:"""
|
||||
def create_file_checkpoint(self, content, format, path):
|
||||
""" -> checkpoint model"""
|
||||
def create_notebook_checkpoint(self, nb, path):
|
||||
""" -> checkpoint model"""
|
||||
def get_file_checkpoint(self, checkpoint_id, path):
|
||||
""" -> {'type': 'file', 'content': <str>, 'format': {'text', 'base64'}}"""
|
||||
def get_notebook_checkpoint(self, checkpoint_id, path):
|
||||
""" -> {'type': 'notebook', 'content': <output of nbformat.read>}"""
|
||||
def delete_checkpoint(self, checkpoint_id, path):
|
||||
"""deletes a checkpoint for a file"""
|
||||
def list_checkpoints(self, path):
|
||||
"""returns a list of checkpoint models for a given file,
|
||||
default just does one per file
|
||||
"""
|
||||
return []
|
||||
def rename_checkpoint(self, checkpoint_id, old_path, new_path):
|
||||
"""renames checkpoint from old path to new path"""
|
||||
class NoOpCheckpoints(GenericCheckpointsMixin, Checkpoints):
|
||||
"""requires the following methods:"""
|
||||
def create_file_checkpoint(self, content, format, path):
|
||||
""" -> checkpoint model"""
|
||||
def create_notebook_checkpoint(self, nb, path):
|
||||
""" -> checkpoint model"""
|
||||
def get_file_checkpoint(self, checkpoint_id, path):
|
||||
""" -> {'type': 'file', 'content': <str>, 'format': {'text', 'base64'}}"""
|
||||
def get_notebook_checkpoint(self, checkpoint_id, path):
|
||||
""" -> {'type': 'notebook', 'content': <output of nbformat.read>}"""
|
||||
def delete_checkpoint(self, checkpoint_id, path):
|
||||
"""deletes a checkpoint for a file"""
|
||||
def list_checkpoints(self, path):
|
||||
"""returns a list of checkpoint models for a given file,
|
||||
default just does one per file
|
||||
"""
|
||||
return []
|
||||
def rename_checkpoint(self, checkpoint_id, old_path, new_path):
|
||||
"""renames checkpoint from old path to new path"""
|
||||
|
||||
See ``GenericFileCheckpoints`` in :mod:`notebook.services.contents.filecheckpoints`
|
||||
for a more complete example.
|
||||
|
Loading…
Reference in New Issue
Block a user