From 1be6a713a6a97a226f38c64311369662707eae52 Mon Sep 17 00:00:00 2001 From: Ville Rantanen Date: Sun, 18 Feb 2018 19:16:21 +0200 Subject: [PATCH] do not display hidden files --- code/app.py | 4 +++- utils/flees-manager.py | 8 ++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/code/app.py b/code/app.py index 3b1a2c1..38b3949 100644 --- a/code/app.py +++ b/code/app.py @@ -11,7 +11,7 @@ import hashlib import zipfile from revprox import ReverseProxied -__FLEES_VERSION__ = "20180218.0" +__FLEES_VERSION__ = "20180218.1" app = Flask(__name__) app.config.from_object(__name__) # Read config from json ! @@ -120,6 +120,8 @@ def list_view(name, password = None): fp = os.path.join(share['path'],file) if os.path.isdir(fp): continue + if file.startswith("."): + continue status = file_stat(fp) status.update({ 'token': get_direct_token(share, file) diff --git a/utils/flees-manager.py b/utils/flees-manager.py index db44fe6..7c8eacb 100755 --- a/utils/flees-manager.py +++ b/utils/flees-manager.py @@ -310,6 +310,10 @@ def print_rest_api(shares, config, opts): print("no files") sys.exit(0) for filename in sorted(os.listdir(share_path)): + if os.path.isdir(os.path.join(share_path,filename)): + continue + if filename.startswith("."): + continue print("%s/download/%s/%s/%s"%( config['public_url'], share['name'], @@ -330,6 +334,10 @@ def print_rest_api(shares, config, opts): print("no files") sys.exit(0) for filename in sorted(os.listdir(share_path)): + if os.path.isdir(os.path.join(share_path,filename)): + continue + if filename.startswith("."): + continue print("%s/direct/%s/%s/%s"%( config['public_url'], share['name'],