def generate(taskid): if 'logged_in' not in session or not session['logged_in']: return render_template('login.html') result = tasks.generate(taskid) if result: return send_file(tasks.taskfile(taskid, tasks.RESULT), as_attachment=True, mimetype='application/pdf', attachment_filename='a5a4_result.pdf') else: return redirect(url_for('task', taskid=taskid))
def getresult(taskid): return send_file(tasks.taskfile(taskid, tasks.RESULT))
def getpng(taskid, img): m = re.match('^([A-Z])(\d+)[LRD]?$', img) if not m: return return send_file(tasks.taskfile(taskid, m.group(1) + str(int(m.group(2))-1) + '.png'))