diff options
| author | Dirk Engling <erdgeist@erdgeist.org> | 2020-04-21 23:47:54 +0200 | 
|---|---|---|
| committer | Dirk Engling <erdgeist@erdgeist.org> | 2020-04-21 23:47:54 +0200 | 
| commit | 0fa16724fd9d1bffb085214846bd5437ca7b7dd2 (patch) | |
| tree | ba02291c9db4e11cd62db20c1a270c79ec7c8f91 | |
| parent | 2460ef593a17eecad863e8702904292cc9706d9e (diff) | |
Have configurable values
| -rwxr-xr-x | Filer.py | 5 | 
1 files changed, 3 insertions, 2 deletions
| @@ -29,7 +29,8 @@ app.config['DROPZONE_DEFAULT_MESSAGE'] = 'Ziehe die Dateien hier hin, um sie hoc | |||
| 29 | 29 | ||
| 30 | dropzone = Dropzone(app) | 30 | dropzone = Dropzone(app) | 
| 31 | 31 | ||
| 32 | basedir = 'Daten' | 32 | basedir = os.getenv('FILER_BASEDIR', './Daten') | 
| 33 | filettl = 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 | ||
