From 32b96a39acce09c89bdf69251a30b82120df456b Mon Sep 17 00:00:00 2001 From: Fluffy-Bean Date: Thu, 20 Apr 2023 17:38:44 +0000 Subject: [PATCH] Black + PyLinty --- onlylegs/__init__.py | 13 +++---------- onlylegs/models.py | 2 +- onlylegs/views/settings.py | 2 +- run.py | 10 +++------- 4 files changed, 8 insertions(+), 19 deletions(-) diff --git a/onlylegs/__init__.py b/onlylegs/__init__.py index 7d1a472..8433882 100644 --- a/onlylegs/__init__.py +++ b/onlylegs/__init__.py @@ -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", diff --git a/onlylegs/models.py b/onlylegs/models.py index 21a1bca..53315b1 100644 --- a/onlylegs/models.py +++ b/onlylegs/models.py @@ -91,7 +91,7 @@ class User(db.Model, UserMixin): # pylint: disable=too-few-public-methods, C010 picture_colour = db.Column(db.String, nullable=True, default=None) banner = db.Column(db.String, nullable=True, default=None) bannner_colour = db.Column(db.String, nullable=True, default=None) - + username = db.Column(db.String, unique=True, nullable=False) email = db.Column(db.String, unique=True, nullable=False) password = db.Column(db.String, nullable=False) diff --git a/onlylegs/views/settings.py b/onlylegs/views/settings.py index d37e459..389433b 100644 --- a/onlylegs/views/settings.py +++ b/onlylegs/views/settings.py @@ -14,4 +14,4 @@ def general(): """ General settings page """ - return render_template("settings.html") \ No newline at end of file + return render_template("settings.html") diff --git a/run.py b/run.py index 5107d3d..8653117 100644 --- a/run.py +++ b/run.py @@ -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()