sort and format

This commit is contained in:
crunk 2023-12-03 14:19:53 +01:00
parent b986b11850
commit 7db20b290e
13 changed files with 50 additions and 93 deletions

View File

@ -3,21 +3,17 @@ import os
import tomllib
import flask_apscheduler
from application.csvparser import CsvParser
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_bcrypt import Bcrypt
from flask_login import LoginManager
from flask_migrate import Migrate
from flask_sqlalchemy import SQLAlchemy
from flask_wtf.csrf import CSRFProtect
from flask_login import (
LoginManager,
)
from whoosh.fields import *
from whoosh.index import create_in
from whoosh.qparser import QueryParser
from application.csvparser import CsvParser
db = SQLAlchemy()
migrate = Migrate()
bcrypt = Bcrypt()
@ -26,6 +22,7 @@ login_manager = LoginManager()
SCRIPT_DIR = os.path.dirname(__file__)
DATA_DIR = os.path.abspath(os.path.join(SCRIPT_DIR, "data"))
def create_app():
settings = settings_from_file()

View File

@ -1,17 +1,17 @@
from uuid import uuid1
from datetime import datetime
from uuid import uuid1
from app import db
from flask import render_template
from flask_mail import Message
from forms.forgotpasswordform import ForgotPasswordForm
from sqlalchemy.exc import (
DataError,
DatabaseError,
DataError,
InterfaceError,
InvalidRequestError,
)
from flask import render_template
from flask_mail import Message
from usermodel import User
from forms.forgotpasswordform import ForgotPasswordForm
from app import db
def ForgotPassword(mail):

View File

@ -1,15 +1,8 @@
from flask import (
render_template,
redirect,
request,
flash,
url_for,
abort,
)
from usermodel import User
from forms.loginform import LoginForm
from flask_login import login_user
from flask import abort, flash, redirect, render_template, request, url_for
from flask_bcrypt import check_password_hash
from flask_login import login_user
from forms.loginform import LoginForm
from usermodel import User
def LoginUser():

View File

@ -1,22 +1,17 @@
from flask import (
render_template,
redirect,
flash,
url_for,
)
from app import db
from flask import flash, redirect, render_template, url_for
from flask_bcrypt import generate_password_hash
from flask_login import login_user
from forms.registerform import RegisterForm
from sqlalchemy.exc import (
IntegrityError,
DataError,
DatabaseError,
DataError,
IntegrityError,
InterfaceError,
InvalidRequestError,
)
from werkzeug.routing import BuildError
from usermodel import User
from forms.registerform import RegisterForm
from flask_login import login_user
from flask_bcrypt import generate_password_hash
from app import db
from werkzeug.routing import BuildError
def RegisterUser():

View File

@ -1,23 +1,19 @@
from datetime import datetime
from flask import (
render_template,
redirect,
flash,
url_for,
)
from app import db
from flask import flash, redirect, render_template, url_for
from flask_bcrypt import generate_password_hash
from flask_login import login_user
from forms.resetpasswordform import ResetPasswordForm
from sqlalchemy.exc import (
IntegrityError,
DataError,
DatabaseError,
DataError,
IntegrityError,
InterfaceError,
InvalidRequestError,
)
from werkzeug.routing import BuildError
from usermodel import User
from forms.resetpasswordform import ResetPasswordForm
from flask_login import login_user
from flask_bcrypt import generate_password_hash
from app import db
from werkzeug.routing import BuildError
def ResetPassword(path):

View File

@ -1,5 +1,5 @@
from app import create_app, db
from flask_migrate import upgrade, migrate, init, stamp
from flask_migrate import init, migrate, stamp, upgrade
def deploy():

View File

@ -1,12 +1,7 @@
"""Forgotten password form to help user."""
from wtforms import (
StringField,
SubmitField,
)
from wtforms import validators
from wtforms.validators import Length, Email
from flask_wtf import FlaskForm
from wtforms import StringField, SubmitField, validators
from wtforms.validators import Email, Length
class ForgotPasswordForm(FlaskForm):

View File

@ -1,13 +1,7 @@
"""Login form to validate user."""
from wtforms import (
StringField,
SubmitField,
PasswordField,
)
from wtforms import validators
from wtforms.validators import Length, Email
from flask_wtf import FlaskForm
from wtforms import PasswordField, StringField, SubmitField, validators
from wtforms.validators import Email, Length
class LoginForm(FlaskForm):

View File

@ -1,13 +1,7 @@
"""Register form to make a new user."""
from wtforms import (
StringField,
SubmitField,
PasswordField,
)
from wtforms import validators
from wtforms.validators import Length, Email, EqualTo, ValidationError
from flask_wtf import FlaskForm
from wtforms import PasswordField, StringField, SubmitField, validators
from wtforms.validators import Email, EqualTo, Length, ValidationError
class RegisterForm(FlaskForm):

View File

@ -1,12 +1,7 @@
"""Reset Password Form form to reset a users PasswordField."""
from wtforms import (
SubmitField,
PasswordField,
)
from wtforms import validators
from wtforms.validators import Length, EqualTo
from flask_wtf import FlaskForm
from wtforms import PasswordField, SubmitField, validators
from wtforms.validators import EqualTo, Length
class ResetPasswordForm(FlaskForm):

View File

@ -6,18 +6,17 @@ import json
import os
import bcrypt
from flask import redirect, render_template, request, Blueprint
from app import create_app
from application.csvparser import CsvParser
from flask import Blueprint, redirect, render_template, request
from flask_wtf.csrf import CSRFProtect
from forms.borrowform import BorrowForm
from forms.uploadform import PublicationForm
from icalendar import Calendar
from PIL import Image
from requests import get
from werkzeug.utils import secure_filename
from app import create_app
from application.csvparser import CsvParser
from forms.borrowform import BorrowForm
from forms.uploadform import PublicationForm
from search import search
from werkzeug.utils import secure_filename
APP = create_app()
csrf = CSRFProtect()

View File

@ -1,11 +1,10 @@
import os
from application.csvparser import CsvParser
from whoosh.fields import *
from whoosh.index import open_dir
from whoosh.qparser import QueryParser
from application.csvparser import CsvParser
SCRIPT_DIR = os.path.dirname(__file__)
DATA_DIR = os.path.abspath(os.path.join(SCRIPT_DIR, "data"))

View File

@ -1,3 +1,3 @@
from setuptools import setup, find_packages
from setuptools import find_packages, setup
setup(name='library', version='1.1', packages=find_packages())
setup(name="library", version="1.1", packages=find_packages())