From fde828e0f12fad1d163740e2b496ebe358d48cca 2014-02-11 11:26:06 From: Konrad Hinsen Date: 2014-02-11 11:26:06 Subject: [PATCH] Add method notebook_exists to NotebookManager. It is called by IPython.html.notebook.NotebookHandler.get, so it must be implemented by every notebook handler. --- diff --git a/IPython/html/services/notebooks/nbmanager.py b/IPython/html/services/notebooks/nbmanager.py index 3efd725..b2b8716 100644 --- a/IPython/html/services/notebooks/nbmanager.py +++ b/IPython/html/services/notebooks/nbmanager.py @@ -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):