Update speedyf/main.py

This commit is contained in:
Fred Boniface 2024-04-30 21:38:18 +01:00
parent 42caef4beb
commit 2464c9bf7c

View File

@ -2,12 +2,20 @@ from flask import Flask, render_template, jsonify, request
app = Flask(__name__) app = Flask(__name__)
job_manager = JobManager() job_manager = JobManager()
@app.route('/', methods=['GET','POST'])
def generate_uuid():
return "random uuid"
@app.route('/')
def index(): def index():
if request.method == 'GET':
render(index.html) render(index.html)
else:
handleform() @app.route('/new_job', methods=['POST'])
def new_job():
## READ FORM, WRITE FILE TO DISK, CALL JOB RUNNER, RETURN JOB_ID
job_id = generate_uuid()
ctx = {job_id: job_id, job_manager: job_manager}
handle_file(file_path, ctx)
@app.route('/job_status') @app.route('/job_status')
def job_status(): def job_status():