diff --git a/js/schema/plugin.json b/js/schema/plugin.json index 0c4b6bc..2ca3d8e 100644 --- a/js/schema/plugin.json +++ b/js/schema/plugin.json @@ -49,7 +49,7 @@ "pattern": "^.+?:\/\/([^:]*:.*@.*|[^@]*)$" }, "type": { - "description": "Directory to be first opened (e.g., myDir/mySubdir)", + "description": "The backend type to use for the resource (PyFS or fsspec)", "type": "string", "enum": ["pyfs", "fsspec"], "default": "pyfs" diff --git a/js/src/index.tsx b/js/src/index.tsx index 8286431..27f13d9 100644 --- a/js/src/index.tsx +++ b/js/src/index.tsx @@ -82,7 +82,7 @@ export const browser: JupyterFrontEndPlugin = { let columns = settings?.composite.display_columns as Array ?? ["size"]; - const sharedSidebarProps: Omit, "url"> = { + const sharedSidebarProps: Omit = { app, manager, paths, diff --git a/jupyterfs/fs_wrapper.py b/jupyterfs/fs_wrapper.py index f464085..ecde1df 100644 --- a/jupyterfs/fs_wrapper.py +++ b/jupyterfs/fs_wrapper.py @@ -37,7 +37,7 @@ def __enter__(self): def __exit__(self, *args): if self.type == "pyfs": - self.fs.__exit__(*args) + return self.fs.__exit__(*args) def _wrap_path(self, path): if self.type == "pyfs": @@ -89,20 +89,14 @@ def writetext(self, path, data): def exists(self, path): path = self._wrap_path(path) - if self.type == "pyfs": - return self.fs.exists(path) return self.fs.exists(path) def isdir(self, path): path = self._wrap_path(path) - if self.type == "pyfs": - return self.fs.isdir(path) return self.fs.isdir(path) def isfile(self, path): path = self._wrap_path(path) - if self.type == "pyfs": - return self.fs.isfile(path) return self.fs.isfile(path) def listdir(self, path): diff --git a/jupyterfs/metamanager.py b/jupyterfs/metamanager.py index 1ac75ed..0cb6464 100644 --- a/jupyterfs/metamanager.py +++ b/jupyterfs/metamanager.py @@ -115,6 +115,9 @@ def initResource(self, *resources, options={}): manager_type = FSManager elif resource["type"] == "fsspec": manager_type = FSSpecManager + else: + # Ensure we don't use manager_type from previous loop iteration + raise FileSystemLoadError(f"Unrecognized filesystem type {resource["type"]!r}") managers[_hash] = manager_type.create( urlSubbed,