From 7d74f9e21d721955cdc6ee922f8b5a5bb1186404 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Thu, 27 Oct 2022 23:35:43 +0200 Subject: [PATCH] Add comments --- src/app.py | 1 + src/config.py | 2 ++ src/routes/api/download.py | 2 ++ src/routes/api/upload.py | 1 + src/routes/index.py | 1 + 5 files changed, 7 insertions(+) diff --git a/src/app.py b/src/app.py index 2734b06..02ff5fc 100644 --- a/src/app.py +++ b/src/app.py @@ -16,4 +16,5 @@ init() @app.route("/") def root() -> Response: + """Root page""" return redirect("index") diff --git a/src/config.py b/src/config.py index 65bc033..9b5da90 100644 --- a/src/config.py +++ b/src/config.py @@ -7,6 +7,7 @@ from utils.sqlite import FilesDB class Config: + """App configuration""" # App name name = "Sand" @@ -26,6 +27,7 @@ class Config: def init() -> None: + """Initialise everything before running the flask server""" # Download dependencies init_font("1.3.0") init_libjs("fc5e3c53e41490e24ca7f67cb24e7ab389b770f9") diff --git a/src/routes/api/download.py b/src/routes/api/download.py index 33cf14a..f9234f8 100644 --- a/src/routes/api/download.py +++ b/src/routes/api/download.py @@ -6,4 +6,6 @@ router = Blueprint("download", __name__) @router.route("", methods=["POST"]) def download() -> Response: + """Download interface""" + # TODO: Send the encrypted file to the javascript client return redirect("index") diff --git a/src/routes/api/upload.py b/src/routes/api/upload.py index 472f063..9c1d2d6 100644 --- a/src/routes/api/upload.py +++ b/src/routes/api/upload.py @@ -10,6 +10,7 @@ router = Blueprint("upload", __name__) @router.route("", methods=["POST"]) def upload() -> Response: + """Upload interface (receive file from javascript client)""" if request.method == "POST": json = request.get_json() if json: diff --git a/src/routes/index.py b/src/routes/index.py index 2acbf0e..015f689 100644 --- a/src/routes/index.py +++ b/src/routes/index.py @@ -6,4 +6,5 @@ router = Blueprint("index", __name__) @router.route("") def index() -> str: + """Index page""" return render_template("index.html", config=Config)