diff --git a/IPython/html/services/contents/clientsidenbmanager.py b/IPython/html/services/contents/clientsidenbmanager.py index 5e8ab35..8428269 100644 --- a/IPython/html/services/contents/clientsidenbmanager.py +++ b/IPython/html/services/contents/clientsidenbmanager.py @@ -5,8 +5,6 @@ from .manager import ContentsManager -import os.path - class ClientSideContentsManager(ContentsManager): """Dummy contents manager for use with client-side contents APIs like GDrive @@ -25,8 +23,11 @@ class ClientSideContentsManager(ContentsManager): return True def get_kernel_path(self, path, model=None): - """Return the initial working dir a kernel associated with a given notebook + """Return the API path for the kernel + + KernelManagers can turn this value into a filesystem path, + or ignore it altogether. - Here just alway return home directory + Here just always return home directory """ - return os.path.expanduser('~') + return '/' diff --git a/IPython/html/services/contents/filemanager.py b/IPython/html/services/contents/filemanager.py index 92465e1..18ae7d8 100644 --- a/IPython/html/services/contents/filemanager.py +++ b/IPython/html/services/contents/filemanager.py @@ -606,9 +606,9 @@ class FileContentsManager(ContentsManager): return "Serving notebooks from local directory: %s" % self.root_dir def get_kernel_path(self, path, model=None): - """Return the initial working dir a kernel associated with a given notebook""" + """Return the initial API path of a kernel associated with a given notebook""" if '/' in path: parent_dir = path.rsplit('/', 1)[0] else: parent_dir = '' - return self._get_os_path(parent_dir) + return parent_dir