add types
This commit is contained in:
parent
7ce888bf94
commit
d56cbea697
7 changed files with 12 additions and 9 deletions
|
@ -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")
|
||||
|
|
|
@ -10,7 +10,7 @@ class Config:
|
|||
uploads_dir = "uploads"
|
||||
|
||||
|
||||
def init():
|
||||
def init() -> None:
|
||||
# Download dependencies
|
||||
init_font("1.3.0")
|
||||
init_libjs("fc5e3c53e41490e24ca7f67cb24e7ab389b770f9")
|
||||
|
|
|
@ -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")
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
Reference in a new issue