Habemus frontend

This commit is contained in:
Marce Coll
2021-11-27 13:05:12 +01:00
parent 603e6dba2b
commit 7a8ae86a1c
3 changed files with 32 additions and 5 deletions

View File

@@ -3,7 +3,7 @@ import re
import flask
text2bool = {"absència": True, "presència": False, "absent": True, "present": False}
text2bool = {"absència": True, "absencia": True, "presencia": False, "presència": False, "absent": True, "present": False}
bool2text = {True: "absent", False: "present"}
app = flask.Flask(__name__)
@@ -43,6 +43,11 @@ def calcula():
return calcula_presencia(frase)
@app.route("/static/<path:path>")
def static_files(path):
return flask.send_from_directory('static', path)
def xor(a, b):
return (a and not b) or (b and not a)