do not display hidden files

This commit is contained in:
Ville Rantanen
2018-02-18 19:16:21 +02:00
parent 6f9d7f465c
commit 1be6a713a6
2 changed files with 11 additions and 1 deletions

View File

@@ -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)

View File

@@ -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'],