rapla-poc
This commit is contained in:
33
app.py
33
app.py
@ -3,22 +3,41 @@ import os
|
||||
from flask import Flask
|
||||
from flask import render_template, url_for, send_from_directory, redirect, request, send_file
|
||||
from werkzeug.utils import secure_filename
|
||||
|
||||
|
||||
from fetchRAPLA import *
|
||||
|
||||
app = Flask(__name__)
|
||||
|
||||
|
||||
@app.route("/")
|
||||
def index():
|
||||
return render_template('index.html', headermessage = 'Header', message='DualHub')
|
||||
return render_template('index.html', headermessage='Header', message='DualHub')
|
||||
|
||||
|
||||
@app.route ("/<string:msg>")
|
||||
@app.route("/<string:msg>")
|
||||
def make_msg(msg):
|
||||
message = msg
|
||||
return render_template('index.html', message="DualHub", headermessage=message)
|
||||
message = msg
|
||||
return render_template('index.html', message="DualHub", headermessage=message)
|
||||
|
||||
|
||||
@app.route("/rapla", methods=["GET", "POST"])
|
||||
def chooseRaplas():
|
||||
r = getRaplas()
|
||||
return render_template("rapla.html", raplas=r)
|
||||
|
||||
|
||||
@app.route("/plan")
|
||||
def getRapla():
|
||||
file = str(request.values.get("file"))
|
||||
url = str(request.values.get("url"))
|
||||
if file != "None":
|
||||
print(file)
|
||||
return send_file("calendars/" + file)
|
||||
elif url != "None":
|
||||
file = getNewRapla(url)
|
||||
if type(file) != int:
|
||||
return send_file("calendars/" + file)
|
||||
return render_template("index.html")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
app.run(host='0.0.0.0', port=2024, debug=True)
|
||||
app.run(host='0.0.0.0', port=2024, debug=True)
|
||||
|
||||
Reference in New Issue
Block a user