more readable imports

This commit is contained in:
stef 2016-08-20 19:37:22 +02:00 committed by Stephane Martin
parent 2731531768
commit 6a043f4a7d
18 changed files with 32 additions and 32 deletions

View file

@ -1,13 +1,12 @@
from __future__ import absolute_import
import functools
import sys
# Set default encoding to UTF-8
reload(sys)
# noinspection PyUnresolvedReferences
sys.setdefaultencoding('utf-8')
import functools
import base64
import time
import json
@ -26,11 +25,11 @@ from werkzeug.routing import BaseConverter
from werkzeug.exceptions import HTTPException
from sqlalchemy.ext.declarative import declarative_base
from .modules.search.models import Search
from .lib.util import to_canonical, remove_ext, mkdir_safe, gravatar_url, to_dict
from .lib.hook import HookModelMeta, HookMixin
from .lib.util import is_su, in_virtualenv
from .version import __version__
from realms.modules.search.models import Search
from realms.lib.util import to_canonical, remove_ext, mkdir_safe, gravatar_url, to_dict
from realms.lib.hook import HookModelMeta, HookMixin
from realms.lib.util import is_su, in_virtualenv
from realms.version import __version__
class Application(Flask):

View file

@ -11,8 +11,8 @@ from multiprocessing import cpu_count
import click
import pip
from . import config, create_app, db, __version__, cli, cache
from .lib.util import random_string, in_virtualenv, green, yellow, red
from realms import config, create_app, db, __version__, cli, cache
from realms.lib.util import random_string, in_virtualenv, green, yellow, red
config = config.conf

View file

@ -4,9 +4,10 @@ import json
import os
import sys
# noinspection PyUnresolvedReferences
from six.moves.urllib.parse import urlparse
from ..lib.util import in_vagrant
from realms.lib.util import in_vagrant
class Config(object):

View file

@ -5,7 +5,7 @@ from datetime import datetime
from sqlalchemy import not_, and_
from .. import db
from realms import db
class Model(db.Model):

View file

@ -3,7 +3,7 @@ from __future__ import absolute_import
from flask import request, flash, redirect
from flask_login import login_url
from ... import login_manager
from realms import login_manager
modules = set()

View file

@ -1,5 +1,5 @@
from __future__ import absolute_import
from ..models import Auth
from realms.modules.auth.models import Auth
Auth.register('ldap')

View file

@ -5,7 +5,7 @@ from flask_login import login_user
from flask_ldap_login import LDAPLoginForm
from realms import ldap
from ..models import BaseUser
from realms.modules.auth.models import BaseUser
users = {}

View file

@ -1,5 +1,5 @@
from __future__ import absolute_import
from ..models import Auth
from realms.modules.auth.models import Auth
Auth.register('local')

View file

@ -2,10 +2,10 @@ from __future__ import absolute_import
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 ....lib.util import random_string
from ....lib.util import green, red, yellow
from .... import cli_group
@cli_group(short_help="Auth Module")

View file

@ -8,7 +8,7 @@ from itsdangerous import URLSafeSerializer, BadSignature
from realms import login_manager, db
from realms.lib.model import Model
from ..models import BaseUser
from realms.modules.auth.models import BaseUser
from .forms import LoginForm

View file

@ -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_login import logout_user
from realms.modules.auth.models import Auth
from .models import Auth
blueprint = Blueprint('auth', __name__, template_folder='templates')

View file

@ -3,8 +3,8 @@ from __future__ import absolute_import
import click
from flask import current_app
from ... import search, cli_group
from ..wiki.models import Wiki
from realms import search, cli_group
from realms.modules.wiki.models import Wiki
@cli_group(short_help="Search Module")

View file

@ -1,7 +1,7 @@
from __future__ import absolute_import
from ..wiki.models import WikiPage
from ... import search
from realms import search
from realms.modules.wiki.models import WikiPage
@WikiPage.after('write')

View file

@ -5,7 +5,7 @@ import sys
from flask import g, current_app
from ...lib.util import filename_to_cname
from realms.lib.util import filename_to_cname
def simple(app):

View file

@ -1,6 +1,6 @@
from __future__ import absolute_import
from ... import assets
from realms import assets
assets.register('editor.js',
'vendor/store-js/store.js',

View file

@ -9,9 +9,9 @@ import yaml
from dulwich.object_store import tree_lookup_path
from dulwich.repo import Repo, NotGitRepository
from ...lib.util import cname_to_filename, filename_to_cname
from ... import cache
from ...lib.hook import HookMixin
from realms import cache
from realms.lib.hook import HookMixin
from realms.lib.util import cname_to_filename, filename_to_cname
class PageNotFound(Exception):

View file

@ -5,8 +5,8 @@ import json
from nose.tools import *
from flask import url_for
from ...lib.util import cname_to_filename, filename_to_cname
from ...lib.test import BaseTest
from realms.lib.util import cname_to_filename, filename_to_cname
from realms.lib.test import BaseTest
class WikiBaseTest(BaseTest):

View file

@ -1,5 +1,5 @@
from setuptools import setup, find_packages
import os
from setuptools import setup, find_packages
if os.environ.get('USER', '') == 'vagrant':
del os.link