From 3c730b09842fa5fcc3245890ab96d681d1855047 Mon Sep 17 00:00:00 2001 From: Yeoh Joer <47742486+yjoer@users.noreply.github.com> Date: Wed, 16 Oct 2024 21:09:29 +0800 Subject: [PATCH] Use a relative path because a path cannot start with a drive letter (#65) --- jupyterlab_quickopen/handler.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/jupyterlab_quickopen/handler.py b/jupyterlab_quickopen/handler.py index bff9e02..51f525a 100644 --- a/jupyterlab_quickopen/handler.py +++ b/jupyterlab_quickopen/handler.py @@ -36,11 +36,13 @@ async def should_hide(self, entry, excludes): ------- bool """ + relpath = os.path.relpath(entry.path) + return ( any(fnmatch(entry.name, glob) for glob in excludes) or not self.contents_manager.should_list(entry.name) or ( - await ensure_async(self.contents_manager.is_hidden(entry.path)) + await ensure_async(self.contents_manager.is_hidden(relpath)) and not self.contents_manager.allow_hidden ) )