more readable imports
This commit is contained in:
parent
2731531768
commit
6a043f4a7d
|
@ -1,13 +1,12 @@
|
||||||
from __future__ import absolute_import
|
from __future__ import absolute_import
|
||||||
|
|
||||||
import functools
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
# Set default encoding to UTF-8
|
# Set default encoding to UTF-8
|
||||||
reload(sys)
|
reload(sys)
|
||||||
# noinspection PyUnresolvedReferences
|
# noinspection PyUnresolvedReferences
|
||||||
sys.setdefaultencoding('utf-8')
|
sys.setdefaultencoding('utf-8')
|
||||||
|
|
||||||
|
import functools
|
||||||
import base64
|
import base64
|
||||||
import time
|
import time
|
||||||
import json
|
import json
|
||||||
|
@ -26,11 +25,11 @@ from werkzeug.routing import BaseConverter
|
||||||
from werkzeug.exceptions import HTTPException
|
from werkzeug.exceptions import HTTPException
|
||||||
from sqlalchemy.ext.declarative import declarative_base
|
from sqlalchemy.ext.declarative import declarative_base
|
||||||
|
|
||||||
from .modules.search.models import Search
|
from realms.modules.search.models import Search
|
||||||
from .lib.util import to_canonical, remove_ext, mkdir_safe, gravatar_url, to_dict
|
from realms.lib.util import to_canonical, remove_ext, mkdir_safe, gravatar_url, to_dict
|
||||||
from .lib.hook import HookModelMeta, HookMixin
|
from realms.lib.hook import HookModelMeta, HookMixin
|
||||||
from .lib.util import is_su, in_virtualenv
|
from realms.lib.util import is_su, in_virtualenv
|
||||||
from .version import __version__
|
from realms.version import __version__
|
||||||
|
|
||||||
|
|
||||||
class Application(Flask):
|
class Application(Flask):
|
||||||
|
|
|
@ -11,8 +11,8 @@ from multiprocessing import cpu_count
|
||||||
import click
|
import click
|
||||||
import pip
|
import pip
|
||||||
|
|
||||||
from . import config, create_app, db, __version__, cli, cache
|
from realms import config, create_app, db, __version__, cli, cache
|
||||||
from .lib.util import random_string, in_virtualenv, green, yellow, red
|
from realms.lib.util import random_string, in_virtualenv, green, yellow, red
|
||||||
|
|
||||||
config = config.conf
|
config = config.conf
|
||||||
|
|
||||||
|
|
|
@ -4,9 +4,10 @@ import json
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
# noinspection PyUnresolvedReferences
|
||||||
from six.moves.urllib.parse import urlparse
|
from six.moves.urllib.parse import urlparse
|
||||||
|
|
||||||
from ..lib.util import in_vagrant
|
from realms.lib.util import in_vagrant
|
||||||
|
|
||||||
|
|
||||||
class Config(object):
|
class Config(object):
|
||||||
|
|
|
@ -5,7 +5,7 @@ from datetime import datetime
|
||||||
|
|
||||||
from sqlalchemy import not_, and_
|
from sqlalchemy import not_, and_
|
||||||
|
|
||||||
from .. import db
|
from realms import db
|
||||||
|
|
||||||
|
|
||||||
class Model(db.Model):
|
class Model(db.Model):
|
||||||
|
|
|
@ -3,7 +3,7 @@ from __future__ import absolute_import
|
||||||
from flask import request, flash, redirect
|
from flask import request, flash, redirect
|
||||||
from flask_login import login_url
|
from flask_login import login_url
|
||||||
|
|
||||||
from ... import login_manager
|
from realms import login_manager
|
||||||
|
|
||||||
modules = set()
|
modules = set()
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
from __future__ import absolute_import
|
from __future__ import absolute_import
|
||||||
|
|
||||||
from ..models import Auth
|
from realms.modules.auth.models import Auth
|
||||||
|
|
||||||
Auth.register('ldap')
|
Auth.register('ldap')
|
||||||
|
|
|
@ -5,7 +5,7 @@ from flask_login import login_user
|
||||||
from flask_ldap_login import LDAPLoginForm
|
from flask_ldap_login import LDAPLoginForm
|
||||||
|
|
||||||
from realms import ldap
|
from realms import ldap
|
||||||
from ..models import BaseUser
|
from realms.modules.auth.models import BaseUser
|
||||||
|
|
||||||
|
|
||||||
users = {}
|
users = {}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
from __future__ import absolute_import
|
from __future__ import absolute_import
|
||||||
|
|
||||||
from ..models import Auth
|
from realms.modules.auth.models import Auth
|
||||||
|
|
||||||
Auth.register('local')
|
Auth.register('local')
|
||||||
|
|
|
@ -2,10 +2,10 @@ from __future__ import absolute_import
|
||||||
|
|
||||||
import click
|
import click
|
||||||
|
|
||||||
|
from realms import cli_group
|
||||||
|
from realms.lib.util import random_string
|
||||||
|
from realms.lib.util import green, red, yellow
|
||||||
from .models import User
|
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")
|
@cli_group(short_help="Auth Module")
|
||||||
|
|
|
@ -8,7 +8,7 @@ from itsdangerous import URLSafeSerializer, BadSignature
|
||||||
|
|
||||||
from realms import login_manager, db
|
from realms import login_manager, db
|
||||||
from realms.lib.model import Model
|
from realms.lib.model import Model
|
||||||
from ..models import BaseUser
|
from realms.modules.auth.models import BaseUser
|
||||||
from .forms import LoginForm
|
from .forms import LoginForm
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@ from __future__ import absolute_import
|
||||||
from flask import current_app, render_template, request, redirect, Blueprint, flash, url_for, session
|
from flask import current_app, render_template, request, redirect, Blueprint, flash, url_for, session
|
||||||
from flask_login import logout_user
|
from flask_login import logout_user
|
||||||
|
|
||||||
from realms.modules.auth.models import Auth
|
from .models import Auth
|
||||||
|
|
||||||
|
|
||||||
blueprint = Blueprint('auth', __name__, template_folder='templates')
|
blueprint = Blueprint('auth', __name__, template_folder='templates')
|
||||||
|
|
|
@ -3,8 +3,8 @@ from __future__ import absolute_import
|
||||||
import click
|
import click
|
||||||
from flask import current_app
|
from flask import current_app
|
||||||
|
|
||||||
from ... import search, cli_group
|
from realms import search, cli_group
|
||||||
from ..wiki.models import Wiki
|
from realms.modules.wiki.models import Wiki
|
||||||
|
|
||||||
|
|
||||||
@cli_group(short_help="Search Module")
|
@cli_group(short_help="Search Module")
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
from __future__ import absolute_import
|
from __future__ import absolute_import
|
||||||
|
|
||||||
from ..wiki.models import WikiPage
|
from realms import search
|
||||||
from ... import search
|
from realms.modules.wiki.models import WikiPage
|
||||||
|
|
||||||
|
|
||||||
@WikiPage.after('write')
|
@WikiPage.after('write')
|
||||||
|
|
|
@ -5,7 +5,7 @@ import sys
|
||||||
|
|
||||||
from flask import g, current_app
|
from flask import g, current_app
|
||||||
|
|
||||||
from ...lib.util import filename_to_cname
|
from realms.lib.util import filename_to_cname
|
||||||
|
|
||||||
|
|
||||||
def simple(app):
|
def simple(app):
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
from __future__ import absolute_import
|
from __future__ import absolute_import
|
||||||
|
|
||||||
from ... import assets
|
from realms import assets
|
||||||
|
|
||||||
assets.register('editor.js',
|
assets.register('editor.js',
|
||||||
'vendor/store-js/store.js',
|
'vendor/store-js/store.js',
|
||||||
|
|
|
@ -9,9 +9,9 @@ import yaml
|
||||||
from dulwich.object_store import tree_lookup_path
|
from dulwich.object_store import tree_lookup_path
|
||||||
from dulwich.repo import Repo, NotGitRepository
|
from dulwich.repo import Repo, NotGitRepository
|
||||||
|
|
||||||
from ...lib.util import cname_to_filename, filename_to_cname
|
from realms import cache
|
||||||
from ... import cache
|
from realms.lib.hook import HookMixin
|
||||||
from ...lib.hook import HookMixin
|
from realms.lib.util import cname_to_filename, filename_to_cname
|
||||||
|
|
||||||
|
|
||||||
class PageNotFound(Exception):
|
class PageNotFound(Exception):
|
||||||
|
|
|
@ -5,8 +5,8 @@ import json
|
||||||
from nose.tools import *
|
from nose.tools import *
|
||||||
from flask import url_for
|
from flask import url_for
|
||||||
|
|
||||||
from ...lib.util import cname_to_filename, filename_to_cname
|
from realms.lib.util import cname_to_filename, filename_to_cname
|
||||||
from ...lib.test import BaseTest
|
from realms.lib.test import BaseTest
|
||||||
|
|
||||||
|
|
||||||
class WikiBaseTest(BaseTest):
|
class WikiBaseTest(BaseTest):
|
||||||
|
|
Loading…
Reference in a new issue