Black + PyLinty

This commit is contained in:
Michał 2023-04-20 17:38:44 +00:00
parent cd3c739398
commit 32b96a39ac
4 changed files with 8 additions and 19 deletions

View file

@ -7,10 +7,7 @@ import logging
import platformdirs
from flask_assets import Bundle
from flask_migrate import init as migrate_init
from flask_migrate import upgrade as migrate_upgrade
from flask_migrate import migrate as migrate_migrate
from flask import Flask, render_template, abort
from werkzeug.exceptions import HTTPException
@ -68,12 +65,6 @@ def create_app(): # pylint: disable=R0914
print("Creating migrations directory")
migrate_init(directory=MIGRATIONS_DIR)
# Check if migrations are up to date
# with app.app_context():
# print("Checking for schema changes...")
# migrate_migrate(directory=MIGRATIONS_DIR)
# migrate_upgrade(directory=MIGRATIONS_DIR)
# LOGIN MANAGER
# can also set session_protection to "strong"
# this would protect against session hijacking
@ -106,7 +97,9 @@ def create_app(): # pylint: disable=R0914
# ASSETS
assets.init_app(app)
scripts = Bundle("js/*.js", output="gen/js.js", depends="js/*.js") # filter jsmin is broken :c
scripts = Bundle(
"js/*.js", output="gen/js.js", depends="js/*.js"
) # filter jsmin is broken :c
styles = Bundle(
"sass/style.sass",
filters="libsass, cssmin",

10
run.py
View file

@ -1,16 +1,13 @@
"""
Run script for OnlyLegs
"""
import importlib.metadata
from setup.args import PORT, ADDRESS, WORKERS, DEBUG
from setup.configuration import Configuration
import importlib.metadata
__version__ = importlib.metadata.version("OnlyLegs")
print(
f"""
f"""
:::::::: :::: ::: ::: ::: ::: ::: ::::::::: ::::::::: ::::::::
:+: :+: :+:+: :+: :+: :+: :+: :+: :+: :+: :+: :+: :+:
+:+ +:+ :+:+:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+
@ -19,12 +16,11 @@ f"""
#+# #+# #+# #+#+# #+# #+# #+# #+# #+# #+# #+# #+#
######## ### #### ########## ### ########## ######### ######### ########
Created by Fluffy Bean - {__version__}
Created by Fluffy Bean - {importlib.metadata.version("OnlyLegs")}
"""
)
# Run pre-startup checks and load configuration
Configuration()