mirror of
https://github.com/uw935/vatsimfox.git
synced 2026-09-17 04:48:58 +00:00
Merge pull request #8 from uw935/feature/minorchanges
Migration to Python 3.8
This commit is contained in:
@@ -1 +1,2 @@
|
||||
__pycache__
|
||||
venv/
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
Project based on [Virtual Air Traffic Simulation Network (VATSIM) API](https://vatsim.dev/).
|
||||
|
||||
Written in Python 3.7.10 + JS (JQuery framework) + Boostrap
|
||||
Written in Python 3.8.18 + JS (JQuery framework) + Boostrap
|
||||
|
||||
## Startup
|
||||
For run application on your own machine, you must install docker. Then just one command in the "src" folder with the project source code:
|
||||
@@ -25,6 +25,20 @@ Any help with this project would be greatly appreciated. Fixes or some features
|
||||
|
||||
VATSIM Fox is free software, open to suggestions and contributions. All the files are under the MIT License.
|
||||
|
||||
### How to set virtual environment
|
||||
|
||||
```bash
|
||||
# you must be in "src" folder before init
|
||||
cd src
|
||||
|
||||
python -m venv venv
|
||||
.\venv\Scripts\activate
|
||||
|
||||
# downloading requirements && upgrading pip
|
||||
python -m pip install --upgrade pip
|
||||
python -m pip install -r requirements.txt
|
||||
```
|
||||
|
||||
## Feature
|
||||
There is small TODO list I would like to make in this project:
|
||||
|
||||
|
||||
@@ -1,3 +1,2 @@
|
||||
[flake8]
|
||||
exclude = .git, pycache, .env, .venv
|
||||
max-line-length = 120
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
FROM python:3.7.10
|
||||
FROM python:3.8.18
|
||||
|
||||
WORKDIR /build/
|
||||
|
||||
|
||||
+3
-5
@@ -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,12 +15,10 @@ 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"})
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="description" content="VATSIM Fox — see your detailed profile statistic">
|
||||
<meta name="description" content="VATSIM Fox — check your detailed profile statistic">
|
||||
<meta name="keywords" content="VATSIM FOX, fox, vatsim, vatsim statistic, statistic, vatsim fox, flight simulator">
|
||||
<meta name="author" content="uw935">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
@@ -27,16 +27,10 @@
|
||||
<div class="container py-4">
|
||||
<header class="pb-3 mb-4 border-bottom">
|
||||
<a href="/" class="d-flex align-items-center text-dark text-decoration-none">
|
||||
<!-- <svg xmlns="http://www.w3.org/2000/svg" width="40" height="32" class="me-2" viewBox="0 0 118 94" role="img"><title>Bootstrap</title><path fill-rule="evenodd" clip-rule="evenodd" d="M24.509 0c-6.733 0-11.715 5.893-11.492 12.284.214 6.14-.064 14.092-2.066 20.577C8.943 39.365 5.547 43.485 0 44.014v5.972c5.547.529 8.943 4.649 10.951 11.153 2.002 6.485 2.28 14.437 2.066 20.577C12.794 88.106 17.776 94 24.51 94H93.5c6.733 0 11.714-5.893 11.491-12.284-.214-6.14.064-14.092 2.066-20.577 2.009-6.504 5.396-10.624 10.943-11.153v-5.972c-5.547-.529-8.934-4.649-10.943-11.153-2.002-6.484-2.28-14.437-2.066-20.577C105.214 5.894 100.233 0 93.5 0H24.508zM80 57.863C80 66.663 73.436 72 62.543 72H44a2 2 0 01-2-2V24a2 2 0 012-2h18.437c9.083 0 15.044 4.92 15.044 12.474 0 5.302-4.01 10.049-9.119 10.88v.277C75.317 46.394 80 51.21 80 57.863zM60.521 28.34H49.948v14.934h8.905c6.884 0 10.68-2.772 10.68-7.727 0-4.643-3.264-7.207-9.012-7.207zM49.948 49.2v16.458H60.91c7.167 0 10.964-2.876 10.964-8.281 0-5.406-3.903-8.178-11.425-8.178H49.948z" fill="currentColor"></path></svg> -->
|
||||
<span class="fs-4">🦊 VATSIM <span class="text-primary">Fox</span></span>
|
||||
</a>
|
||||
</header>
|
||||
|
||||
<!-- <div class="mb-4 alert alert-primary" role="alert">
|
||||
Notification
|
||||
</div>
|
||||
-->
|
||||
|
||||
{% block content %}{% endblock %}
|
||||
|
||||
<footer class="pt-3 mt-4 text-muted border-top">
|
||||
|
||||
@@ -34,9 +34,9 @@
|
||||
{% block javascript_code %}
|
||||
<script type="text/javascript">
|
||||
$(".fox_submit").click(function() {
|
||||
const INPUT_CID = 0 + $(".fox_input").val();
|
||||
const INPUT_CID = $(".fox_input").val();
|
||||
|
||||
if ((0 + INPUT_CID) < 100000) {
|
||||
if (INPUT_CID < 100000) {
|
||||
$(".fox_message").text("CID should be equal or more than 100000");
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user