summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDirk Engling <erdgeist@erdgeist.org>2020-04-21 23:47:54 +0200
committerDirk Engling <erdgeist@erdgeist.org>2020-04-21 23:47:54 +0200
commit0fa16724fd9d1bffb085214846bd5437ca7b7dd2 (patch)
treeba02291c9db4e11cd62db20c1a270c79ec7c8f91
parent2460ef593a17eecad863e8702904292cc9706d9e (diff)
Have configurable values
-rwxr-xr-xFiler.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/Filer.py b/Filer.py
index b7defd8..ddafd08 100755
--- a/Filer.py
+++ b/Filer.py
@@ -29,7 +29,8 @@ app.config['DROPZONE_DEFAULT_MESSAGE'] = 'Ziehe die Dateien hier hin, um sie hoc
29 29
30dropzone = Dropzone(app) 30dropzone = Dropzone(app)
31 31
32basedir = 'Daten' 32basedir = os.getenv('FILER_BASEDIR', './Daten')
33filettl = int(os.getenv('FILER_FILETTL', 10))
33 34
34#### ADMIN FACING DIRECTORY LISTS #### 35#### ADMIN FACING DIRECTORY LISTS ####
35#### 36####
@@ -151,7 +152,7 @@ def make_tree(rel, path):
151 if os.path.isdir(os.path.join(rel,fn)): 152 if os.path.isdir(os.path.join(rel,fn)):
152 tree['children'].append(make_tree(rel, fn)) 153 tree['children'].append(make_tree(rel, fn))
153 else: 154 else:
154 ttl = 10 - int((time.time() - os.path.getmtime(os.path.join(rel,fn))) / (24*3600)) 155 ttl = filettl - int((time.time() - os.path.getmtime(os.path.join(rel,fn))) / (24*3600))
155 tree['children'].append(dict(name=fn, download=name, ttl = ttl)) 156 tree['children'].append(dict(name=fn, download=name, ttl = ttl))
156 return tree 157 return tree
157 158