From 1c59d76b1784bc08a1ef69fb5e77aaec1cadc23c Mon Sep 17 00:00:00 2001 From: Sebastian Speitel Date: Sat, 14 Dec 2019 13:05:09 +0100 Subject: [PATCH 1/3] Added modules --- app.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/app.py b/app.py index 6499def..8b6e7fd 100644 --- a/app.py +++ b/app.py @@ -14,6 +14,36 @@ def tu_ilmenau(): def about(): return redirect("https://github.com/clerie/walduni", code=302) +@app.route('/modultafeln/') +@app.route('/modultafel/') +@app.route('/modulplan/') +@app.route('/module/') +def modultafeln(course): + + courseToPath = { + "amw": "AngewandteMedienundKommunikationswissenschaft/Bachelor/2014", + "amk": "AngewandteMedienundKommunikationswissenschaft/Bachelor/2014", + "bmt": "BiomedizinischeTechnik/Bachelor/2014/", + "btc": "BiotechnischeChemie/Bachelor/2013/", + "eit": "ElektrotechnikundInformationstechnik/Bachelor/2013/", + "ft": "Fahrzeugtechnik/Bachelor/2013/", + "in": "Informatik/Bachelor/2013/", + "ii": "Ingenieurinformatik/Bachelor/2013/", + "mb": "Maschinenbau/Bachelor/2013/", + "mathe": "Mathematik/Bachelor/2013/", + "mechatronik": "Mechatronik/Bachelor/2013/", + "mt": "Medientechnologie/Bachelor/2013/", + "mw": "Medienwirtschaft/Bachelor/2015/", + "oso": "OptischeSystemtechnikOptronik/Bachelor/2013/", + "tks": "TechnischeKybernetikundSystemtheorie/Bachelor/2013/", + "physik": "TechnischePhysik/Bachelor/2013/", + "ww": "Werkstoffwissenschaft/Bachelor/2013/", + "wi": "Wirtschaftsinformatik/Bachelor/2015/", + "wiw": "Wirtschaftsingenieurwesen/Bachelor/2015/?vertiefung=MB" + } + + return redirect("https://www.tu-ilmenau.de/modultafeln/" + courseToPath.get(course, ""), code=302) + if __name__ == '__main__': # Bind to PORT if defined, otherwise default to 5000. port = int(os.environ.get('PORT', 5000)) From 622628419b81bcf9fd3b3cb23a040a9cd60beca1 Mon Sep 17 00:00:00 2001 From: Sebastian Speitel Date: Sat, 14 Dec 2019 13:46:10 +0100 Subject: [PATCH 2/3] Removed incorrect url converter str --- app.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app.py b/app.py index 8b6e7fd..a2616c3 100644 --- a/app.py +++ b/app.py @@ -14,10 +14,10 @@ def tu_ilmenau(): def about(): return redirect("https://github.com/clerie/walduni", code=302) -@app.route('/modultafeln/') -@app.route('/modultafel/') -@app.route('/modulplan/') -@app.route('/module/') +@app.route('/modultafeln/') +@app.route('/modultafel/') +@app.route('/modulplan/') +@app.route('/module/') def modultafeln(course): courseToPath = { From c4cdf2dfd2d5edc165e24bfa2647c39447a4d9b2 Mon Sep 17 00:00:00 2001 From: Sebastian Speitel Date: Sat, 14 Dec 2019 13:54:18 +0100 Subject: [PATCH 3/3] Added catchall --- app.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/app.py b/app.py index a2616c3..a2f62c0 100644 --- a/app.py +++ b/app.py @@ -14,11 +14,15 @@ def tu_ilmenau(): def about(): return redirect("https://github.com/clerie/walduni", code=302) -@app.route('/modultafeln/') -@app.route('/modultafel/') -@app.route('/modulplan/') -@app.route('/module/') -def modultafeln(course): +@app.route('/modultafeln//') +@app.route('/modultafel//') +@app.route('/modulplan//') +@app.route('/module//') +@app.route('/modultafeln/') +@app.route('/modultafel/') +@app.route('/modulplan/') +@app.route('/module/') +def modultafeln(course=""): courseToPath = { "amw": "AngewandteMedienundKommunikationswissenschaft/Bachelor/2014",