systematic use of from __future__ import absolute_import
. it eliminates import NAME
confusion with very common names (eg. import ldap
is very ambiguous: can be a ldap module from realms-wiki, a ldap module from flask-ldap-login, or python-ldap
module.
also cleant up a bit the import towards PEP8: builtin modules first, then 3rd party python packages, then local packages
This commit is contained in:
parent
2919be6b87
commit
2731531768
38 changed files with 156 additions and 42 deletions
|
@ -1,3 +1,5 @@
|
|||
from __future__ import absolute_import
|
||||
|
||||
from ..models import Auth
|
||||
|
||||
Auth.register('local')
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
from __future__ import absolute_import
|
||||
|
||||
import click
|
||||
from realms.lib.util import random_string
|
||||
from realms.modules.auth.local.models import User
|
||||
from realms.lib.util import green, red, yellow
|
||||
from realms import cli_group
|
||||
|
||||
from .models import User
|
||||
from ....lib.util import random_string
|
||||
from ....lib.util import green, red, yellow
|
||||
from .... import cli_group
|
||||
|
||||
|
||||
@cli_group(short_help="Auth Module")
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
from __future__ import absolute_import
|
||||
|
||||
from flask_wtf import Form
|
||||
from wtforms import StringField, PasswordField, validators
|
||||
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
from __future__ import absolute_import
|
||||
|
||||
from flask import current_app
|
||||
from flask_wtf import RecaptchaField
|
||||
|
||||
from .forms import RegistrationForm
|
||||
|
||||
|
||||
|
|
|
@ -1,11 +1,15 @@
|
|||
from __future__ import absolute_import
|
||||
|
||||
from hashlib import sha256
|
||||
|
||||
from flask import current_app, render_template
|
||||
from flask_login import logout_user, login_user
|
||||
from itsdangerous import URLSafeSerializer, BadSignature
|
||||
|
||||
from realms import login_manager, db
|
||||
from realms.lib.model import Model
|
||||
from ..models import BaseUser
|
||||
from .forms import LoginForm
|
||||
from itsdangerous import URLSafeSerializer, BadSignature
|
||||
from hashlib import sha256
|
||||
|
||||
|
||||
@login_manager.token_loader
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
from __future__ import absolute_import
|
||||
|
||||
from flask import current_app, render_template, request, redirect, Blueprint, flash, url_for, session
|
||||
from realms.modules.auth.local.models import User
|
||||
from realms.modules.auth.local.forms import LoginForm, RegistrationForm
|
||||
|
||||
from .models import User
|
||||
from .forms import LoginForm, RegistrationForm
|
||||
|
||||
|
||||
blueprint = Blueprint('auth.local', __name__)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue