Add method notebook_exists to NotebookManager.

It is called by IPython.html.notebook.NotebookHandler.get,
so it must be implemented by every notebook handler.
This commit is contained in:
Konrad Hinsen 2014-02-10 17:07:37 +01:00
parent 26e3e31ad8
commit 0a430f5840

View File

@ -129,6 +129,22 @@ class NotebookManager(LoggingConfigurable):
"""
return basename
def notebook_exists(self, name, path=''):
"""Returns a True if the notebook exists. Else, returns False.
Parameters
----------
name : string
The name of the notebook you are checking.
path : string
The relative path to the notebook (with '/' as separator)
Returns
-------
bool
"""
raise NotImplementedError('must be implemented in a subclass')
# TODO: Remove this after we create the contents web service and directories are
# no longer listed by the notebook web service.
def list_dirs(self, path):