add types

This commit is contained in:
Mylloon 2022-10-27 16:19:11 +02:00
parent 7ce888bf94
commit d56cbea697
Signed by: Anri
GPG key ID: A82D63DFF8D1317F
7 changed files with 12 additions and 9 deletions

View file

@ -1,4 +1,5 @@
from flask import Flask, redirect
from werkzeug.wrappers.response import Response
from config import init
from routes.api.download import router as api_download
@ -14,5 +15,5 @@ init()
@app.route("/")
def root():
def root() -> Response:
return redirect("index")

View file

@ -10,7 +10,7 @@ class Config:
uploads_dir = "uploads"
def init():
def init() -> None:
# Download dependencies
init_font("1.3.0")
init_libjs("fc5e3c53e41490e24ca7f67cb24e7ab389b770f9")

View file

@ -1,8 +1,9 @@
from flask import Blueprint, redirect, request
from flask import Blueprint, redirect
from werkzeug.wrappers.response import Response
router = Blueprint("download", __name__)
@router.route("", methods=["POST"])
def download():
def download() -> Response:
return redirect("index")

View file

@ -1,12 +1,13 @@
from config import Config
from flask import Blueprint, redirect, request
from utils.misc import h
from werkzeug.wrappers.response import Response
router = Blueprint("upload", __name__)
@router.route("", methods=["POST"])
def upload():
def upload() -> Response:
if request.method == "POST":
json = request.get_json()
if json:

View file

@ -1,9 +1,9 @@
from flask import Blueprint, render_template
from config import Config
from flask import Blueprint, render_template
router = Blueprint("index", __name__)
@router.route("")
def index():
def index() -> str:
return render_template("index.html", name=Config.name)

View file

@ -5,7 +5,7 @@ from requests import get
from utils.misc import exist
def init(version):
def init(version: str) -> None:
""" Download font """
path = "./src/public/fonts"
filename = "RiluRegular.ttf"

View file

@ -5,7 +5,7 @@ from requests import get
from utils.misc import exist
def init(commit_hash):
def init(commit_hash: str) -> None:
""" Download JS libraries"""
path = "./src/public/js/libs"
filename = "bigint-mod.js"