From 90ac6c87ac187f7f81ec49d314afe9d91686205e Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Sat, 31 Oct 2020 01:00:06 -0700 Subject: [PATCH] Move the hidden filenames (thumbs.db etc) to a global const. --- SimpleServer/simpleserver.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/SimpleServer/simpleserver.py b/SimpleServer/simpleserver.py index 43af56f..1dc5c2f 100644 --- a/SimpleServer/simpleserver.py +++ b/SimpleServer/simpleserver.py @@ -55,6 +55,7 @@ PASSWORD_PROMPT_HTML = ''' ''' ROOT_DIRECTORY = pathclass.Path(os.getcwd()) +HIDDEN_FILENAMES = {'thumbs.db', 'desktop.ini', '$recycle.bin', 'system volume information'} TOKEN_COOKIE_NAME = 'simpleserver_token' # SERVER ########################################################################################### @@ -358,7 +359,7 @@ def generate_opendir(path): files = [] for item in sorted(items, key=lambda p: p.basename.lower()): - if item.basename.lower() in {'thumbs.db', 'desktop.ini', '$recycle.bin'}: + if item.basename.lower() in HIDDEN_FILENAMES: continue if item.is_dir: directories.append(item)