okay, i agree this is cleaner
parent
48567e9432
commit
a1c1f24087
|
@ -49,8 +49,9 @@ def send_thumb(tgt):
|
|||
image.resize(map(int, (scale * sz[0], scale * sz[1])), Image.ANTIALIAS).save(thumb_path)
|
||||
return send_file(thumb_path)
|
||||
|
||||
@app.route('/')
|
||||
@app.route('/<path:tgt>')
|
||||
def view(tgt):
|
||||
def view(tgt=''):
|
||||
try:
|
||||
path = abspath(safe_join(base, tgt))
|
||||
names = map(lambda s: s.decode(app.config['CHARSET']), os.listdir(path))
|
||||
|
@ -61,7 +62,6 @@ def view(tgt):
|
|||
if e.errno == 2:
|
||||
abort(404)
|
||||
|
||||
app.route('/')(lambda: view(''))
|
||||
|
||||
if __name__ == '__main__':
|
||||
app.run('::', 8080, debug=True)
|
||||
|
|
Loading…
Reference in New Issue