From a06827b1d2ef5f03ce7d58832fc3aebdecb0b0e7 Mon Sep 17 00:00:00 2001 From: te5154c Date: Mon, 26 Feb 2024 23:52:31 +0300 Subject: [PATCH] switch to new python version && minor bugs fixed --- setup.cfg | 3 +-- src/Dockerfile | 2 +- src/app.py | 10 ++++------ src/templates/4O4.html | 12 ++++++------ src/templates/include/template.html | 14 ++++---------- src/templates/index.html | 8 ++++---- 6 files changed, 20 insertions(+), 29 deletions(-) diff --git a/setup.cfg b/setup.cfg index 16dcbf3..1d800fe 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,3 +1,2 @@ [flake8] -exclude = .git, pycache, .env, .venv -max-line-length = 120 \ No newline at end of file +exclude = .git, pycache, .env, .venv \ No newline at end of file diff --git a/src/Dockerfile b/src/Dockerfile index dd45b5b..fa48558 100644 --- a/src/Dockerfile +++ b/src/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.7.10 +FROM python:3.8.18 WORKDIR /build/ diff --git a/src/app.py b/src/app.py index 9135d1e..00d3658 100644 --- a/src/app.py +++ b/src/app.py @@ -1,5 +1,5 @@ -from flask import Flask, render_template, abort, request, jsonify import requests +from flask import Flask, render_template, abort, request, jsonify app = Flask(__name__) @@ -15,14 +15,12 @@ def index_page(): def errorhandler_page(_): return render_template("4O4.html"), 404 -# Custom wrapper to fetch VATSIM data + @app.route("/api/request") def request_handler(): - request_string = request.args.get("request_string") - - if request_string: + if request_string := request.args.get("request_string"): return requests.get(f"{VATSIM_API_URL}{request_string}").json() - + return jsonify({"result": "not found"}) diff --git a/src/templates/4O4.html b/src/templates/4O4.html index eb51781..0624252 100644 --- a/src/templates/4O4.html +++ b/src/templates/4O4.html @@ -2,11 +2,11 @@ {% block title %}404 - Not Found / VATSIM Fox{% endblock %} {% block content %}
-
-

4O4 - Page Not Found

- - - -
+
+

4O4 - Page Not Found

+ + + +
{% endblock %} \ No newline at end of file diff --git a/src/templates/include/template.html b/src/templates/include/template.html index ffc0ab8..ed73ee1 100644 --- a/src/templates/include/template.html +++ b/src/templates/include/template.html @@ -2,7 +2,7 @@ - + @@ -18,25 +18,19 @@ {% block header_css %}{% endblock %}
- 🦊 VATSIM Fox
- - {% block content %}{% endblock %}