Skip to content

Commit

Permalink
The root directory of the notebook server should never be hidden
Browse files Browse the repository at this point in the history
  • Loading branch information
takluyver committed Oct 6, 2017
1 parent 9b4660f commit 44c3224
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions notebook/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,10 @@ def is_hidden(abs_path, abs_root=''):
determined by either name starting with '.' or the UF_HIDDEN flag as
reported by stat.
If abs_path is the same directory as abs_root, it will be visible even if
that is a hidden folder. This only checks the visibility of files
and directories *within* abs_root.
Parameters
----------
abs_path : unicode
Expand All @@ -181,6 +185,9 @@ def is_hidden(abs_path, abs_root=''):
The absolute path of the root directory in which hidden directories
should be checked for.
"""
if os.path.normpath(abs_path) == os.path.normpath(abs_root):
return False

if is_file_hidden(abs_path):
return True

Expand Down

0 comments on commit 44c3224

Please sign in to comment.