sort and format
This commit is contained in:
parent
b986b11850
commit
7db20b290e
@ -3,21 +3,17 @@ import os
|
|||||||
import tomllib
|
import tomllib
|
||||||
|
|
||||||
import flask_apscheduler
|
import flask_apscheduler
|
||||||
|
from application.csvparser import CsvParser
|
||||||
from flask import Flask
|
from flask import Flask
|
||||||
from flask_sqlalchemy import SQLAlchemy
|
|
||||||
from flask_bcrypt import Bcrypt
|
from flask_bcrypt import Bcrypt
|
||||||
|
from flask_login import LoginManager
|
||||||
from flask_migrate import Migrate
|
from flask_migrate import Migrate
|
||||||
|
from flask_sqlalchemy import SQLAlchemy
|
||||||
from flask_wtf.csrf import CSRFProtect
|
from flask_wtf.csrf import CSRFProtect
|
||||||
from flask_login import (
|
|
||||||
LoginManager,
|
|
||||||
)
|
|
||||||
|
|
||||||
from whoosh.fields import *
|
from whoosh.fields import *
|
||||||
from whoosh.index import create_in
|
from whoosh.index import create_in
|
||||||
from whoosh.qparser import QueryParser
|
from whoosh.qparser import QueryParser
|
||||||
|
|
||||||
from application.csvparser import CsvParser
|
|
||||||
|
|
||||||
db = SQLAlchemy()
|
db = SQLAlchemy()
|
||||||
migrate = Migrate()
|
migrate = Migrate()
|
||||||
bcrypt = Bcrypt()
|
bcrypt = Bcrypt()
|
||||||
@ -26,6 +22,7 @@ login_manager = LoginManager()
|
|||||||
SCRIPT_DIR = os.path.dirname(__file__)
|
SCRIPT_DIR = os.path.dirname(__file__)
|
||||||
DATA_DIR = os.path.abspath(os.path.join(SCRIPT_DIR, "data"))
|
DATA_DIR = os.path.abspath(os.path.join(SCRIPT_DIR, "data"))
|
||||||
|
|
||||||
|
|
||||||
def create_app():
|
def create_app():
|
||||||
settings = settings_from_file()
|
settings = settings_from_file()
|
||||||
|
|
||||||
|
@ -1,17 +1,17 @@
|
|||||||
from uuid import uuid1
|
|
||||||
from datetime import datetime
|
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 (
|
from sqlalchemy.exc import (
|
||||||
DataError,
|
|
||||||
DatabaseError,
|
DatabaseError,
|
||||||
|
DataError,
|
||||||
InterfaceError,
|
InterfaceError,
|
||||||
InvalidRequestError,
|
InvalidRequestError,
|
||||||
)
|
)
|
||||||
from flask import render_template
|
|
||||||
from flask_mail import Message
|
|
||||||
|
|
||||||
from usermodel import User
|
from usermodel import User
|
||||||
from forms.forgotpasswordform import ForgotPasswordForm
|
|
||||||
from app import db
|
|
||||||
|
|
||||||
|
|
||||||
def ForgotPassword(mail):
|
def ForgotPassword(mail):
|
||||||
|
@ -1,15 +1,8 @@
|
|||||||
from flask import (
|
from flask import abort, flash, redirect, render_template, request, url_for
|
||||||
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_bcrypt import check_password_hash
|
from flask_bcrypt import check_password_hash
|
||||||
|
from flask_login import login_user
|
||||||
|
from forms.loginform import LoginForm
|
||||||
|
from usermodel import User
|
||||||
|
|
||||||
|
|
||||||
def LoginUser():
|
def LoginUser():
|
||||||
|
@ -1,22 +1,17 @@
|
|||||||
from flask import (
|
from app import db
|
||||||
render_template,
|
from flask import flash, redirect, render_template, url_for
|
||||||
redirect,
|
from flask_bcrypt import generate_password_hash
|
||||||
flash,
|
from flask_login import login_user
|
||||||
url_for,
|
from forms.registerform import RegisterForm
|
||||||
)
|
|
||||||
from sqlalchemy.exc import (
|
from sqlalchemy.exc import (
|
||||||
IntegrityError,
|
|
||||||
DataError,
|
|
||||||
DatabaseError,
|
DatabaseError,
|
||||||
|
DataError,
|
||||||
|
IntegrityError,
|
||||||
InterfaceError,
|
InterfaceError,
|
||||||
InvalidRequestError,
|
InvalidRequestError,
|
||||||
)
|
)
|
||||||
from werkzeug.routing import BuildError
|
|
||||||
from usermodel import User
|
from usermodel import User
|
||||||
from forms.registerform import RegisterForm
|
from werkzeug.routing import BuildError
|
||||||
from flask_login import login_user
|
|
||||||
from flask_bcrypt import generate_password_hash
|
|
||||||
from app import db
|
|
||||||
|
|
||||||
|
|
||||||
def RegisterUser():
|
def RegisterUser():
|
||||||
|
@ -1,23 +1,19 @@
|
|||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from flask import (
|
|
||||||
render_template,
|
from app import db
|
||||||
redirect,
|
from flask import flash, redirect, render_template, url_for
|
||||||
flash,
|
from flask_bcrypt import generate_password_hash
|
||||||
url_for,
|
from flask_login import login_user
|
||||||
)
|
from forms.resetpasswordform import ResetPasswordForm
|
||||||
from sqlalchemy.exc import (
|
from sqlalchemy.exc import (
|
||||||
IntegrityError,
|
|
||||||
DataError,
|
|
||||||
DatabaseError,
|
DatabaseError,
|
||||||
|
DataError,
|
||||||
|
IntegrityError,
|
||||||
InterfaceError,
|
InterfaceError,
|
||||||
InvalidRequestError,
|
InvalidRequestError,
|
||||||
)
|
)
|
||||||
from werkzeug.routing import BuildError
|
|
||||||
from usermodel import User
|
from usermodel import User
|
||||||
from forms.resetpasswordform import ResetPasswordForm
|
from werkzeug.routing import BuildError
|
||||||
from flask_login import login_user
|
|
||||||
from flask_bcrypt import generate_password_hash
|
|
||||||
from app import db
|
|
||||||
|
|
||||||
|
|
||||||
def ResetPassword(path):
|
def ResetPassword(path):
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
from app import create_app, db
|
from app import create_app, db
|
||||||
from flask_migrate import upgrade, migrate, init, stamp
|
from flask_migrate import init, migrate, stamp, upgrade
|
||||||
|
|
||||||
|
|
||||||
def deploy():
|
def deploy():
|
||||||
|
@ -1,12 +1,7 @@
|
|||||||
"""Forgotten password form to help user."""
|
"""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 flask_wtf import FlaskForm
|
||||||
|
from wtforms import StringField, SubmitField, validators
|
||||||
|
from wtforms.validators import Email, Length
|
||||||
|
|
||||||
|
|
||||||
class ForgotPasswordForm(FlaskForm):
|
class ForgotPasswordForm(FlaskForm):
|
||||||
|
@ -1,13 +1,7 @@
|
|||||||
"""Login form to validate user."""
|
"""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 flask_wtf import FlaskForm
|
||||||
|
from wtforms import PasswordField, StringField, SubmitField, validators
|
||||||
|
from wtforms.validators import Email, Length
|
||||||
|
|
||||||
|
|
||||||
class LoginForm(FlaskForm):
|
class LoginForm(FlaskForm):
|
||||||
|
@ -1,13 +1,7 @@
|
|||||||
"""Register form to make a new user."""
|
"""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 flask_wtf import FlaskForm
|
||||||
|
from wtforms import PasswordField, StringField, SubmitField, validators
|
||||||
|
from wtforms.validators import Email, EqualTo, Length, ValidationError
|
||||||
|
|
||||||
|
|
||||||
class RegisterForm(FlaskForm):
|
class RegisterForm(FlaskForm):
|
||||||
|
@ -1,12 +1,7 @@
|
|||||||
"""Reset Password Form form to reset a users PasswordField."""
|
"""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 flask_wtf import FlaskForm
|
||||||
|
from wtforms import PasswordField, SubmitField, validators
|
||||||
|
from wtforms.validators import EqualTo, Length
|
||||||
|
|
||||||
|
|
||||||
class ResetPasswordForm(FlaskForm):
|
class ResetPasswordForm(FlaskForm):
|
||||||
|
@ -6,18 +6,17 @@ import json
|
|||||||
import os
|
import os
|
||||||
|
|
||||||
import bcrypt
|
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 flask_wtf.csrf import CSRFProtect
|
||||||
|
from forms.borrowform import BorrowForm
|
||||||
|
from forms.uploadform import PublicationForm
|
||||||
from icalendar import Calendar
|
from icalendar import Calendar
|
||||||
from PIL import Image
|
from PIL import Image
|
||||||
from requests import get
|
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 search import search
|
||||||
|
from werkzeug.utils import secure_filename
|
||||||
|
|
||||||
APP = create_app()
|
APP = create_app()
|
||||||
csrf = CSRFProtect()
|
csrf = CSRFProtect()
|
||||||
|
@ -1,11 +1,10 @@
|
|||||||
import os
|
import os
|
||||||
|
|
||||||
|
from application.csvparser import CsvParser
|
||||||
from whoosh.fields import *
|
from whoosh.fields import *
|
||||||
from whoosh.index import open_dir
|
from whoosh.index import open_dir
|
||||||
from whoosh.qparser import QueryParser
|
from whoosh.qparser import QueryParser
|
||||||
|
|
||||||
from application.csvparser import CsvParser
|
|
||||||
|
|
||||||
SCRIPT_DIR = os.path.dirname(__file__)
|
SCRIPT_DIR = os.path.dirname(__file__)
|
||||||
DATA_DIR = os.path.abspath(os.path.join(SCRIPT_DIR, "data"))
|
DATA_DIR = os.path.abspath(os.path.join(SCRIPT_DIR, "data"))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user