From 87ed5a55d4231ae711d17b69808ffd94ae443fa2 Mon Sep 17 00:00:00 2001 From: jaseg Date: Sun, 29 Sep 2019 13:40:05 +0200 Subject: Add raw kicad file download --- webapp/pogojig.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'webapp') diff --git a/webapp/pogojig.py b/webapp/pogojig.py index 9312cf5..16d4a51 100644 --- a/webapp/pogojig.py +++ b/webapp/pogojig.py @@ -93,15 +93,16 @@ def upload_svg(): flash(f'Error uploading SVG file: {"; ".join(msg for elem in upload_form.errors.values() for msg in elem)}', 'error') return redirect(url_for('jigerator')) -@app.route('/render/download/') +@app.route('/render/download/') def render_download(file): - if file not in ['jig.stl', 'pcb_shape.dxf', 'kicad.zip', 'sources.zip']: + if file not in ['jig.stl', 'pcb_shape.dxf', 'kicad.zip', 'sources.zip', + 'kicad/jig-cache.lib', 'kicad/jig.kicad_pcb', 'kicad/jig.pro', 'kicad/jig.sch']: abort(404) return send_file(tempfile_path(file), mimetype='application/zip', as_attachment=True, - attachment_filename=f'{path.splitext(session["filename"])[0]}_pogojig.zip') + attachment_filename=f'{path.splitext(session["filename"])[0]}_{path.basename(file)}') @app.route('/pogojig_template_empty.svg') def static_template(): -- cgit