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
|
@ -0,0 +1 @@
|
|||
from __future__ import absolute_import
|
|
@ -1,7 +1,10 @@
|
|||
from __future__ import absolute_import
|
||||
|
||||
import click
|
||||
from flask import current_app
|
||||
from realms import search, cli_group
|
||||
from realms.modules.wiki.models import Wiki
|
||||
|
||||
from ... import search, cli_group
|
||||
from ..wiki.models import Wiki
|
||||
|
||||
|
||||
@cli_group(short_help="Search Module")
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
from realms.modules.wiki.models import WikiPage
|
||||
from realms import search
|
||||
from __future__ import absolute_import
|
||||
|
||||
from ..wiki.models import WikiPage
|
||||
from ... import search
|
||||
|
||||
|
||||
@WikiPage.after('write')
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
from __future__ import absolute_import
|
||||
|
||||
import re
|
||||
import sys
|
||||
|
||||
from flask import g, current_app
|
||||
from realms.lib.util import filename_to_cname
|
||||
|
||||
from ...lib.util import filename_to_cname
|
||||
|
||||
|
||||
def simple(app):
|
||||
|
|
|
@ -1,7 +1,11 @@
|
|||
from __future__ import absolute_import
|
||||
|
||||
from flask import render_template, request, Blueprint, current_app
|
||||
from flask_login import current_user
|
||||
|
||||
from realms import search as search_engine
|
||||
|
||||
|
||||
blueprint = Blueprint('search', __name__, template_folder='templates')
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue