diff --git a/.isort.cfg b/.isort.cfg new file mode 100644 index 0000000000..e1c6495da9 --- /dev/null +++ b/.isort.cfg @@ -0,0 +1,3 @@ +[settings] +multi_line_output=4 +known_first_party=trytond diff --git a/__init__.py b/__init__.py index 58454d4b10..b3f2573b78 100644 --- a/__init__.py +++ b/__init__.py @@ -3,8 +3,7 @@ from trytond.pool import Pool -from . import web -from . import routes +from . import routes, web __all__ = ['register', 'routes'] diff --git a/routes.py b/routes.py index d5dd9c5da2..6b88d16338 100644 --- a/routes.py +++ b/routes.py @@ -6,8 +6,8 @@ try: except ImportError: from http import client as HTTPStatus -from werkzeug.utils import redirect from werkzeug.exceptions import abort +from werkzeug.utils import redirect from trytond.protocols.wrappers import with_pool, with_transaction from trytond.wsgi import app diff --git a/setup.py b/setup.py index 9c16a43c5b..a05aa76aab 100755 --- a/setup.py +++ b/setup.py @@ -6,7 +6,8 @@ import io import os import re from configparser import ConfigParser -from setuptools import setup, find_packages + +from setuptools import find_packages, setup def read(fname): diff --git a/tests/test_web_shortener.py b/tests/test_web_shortener.py index 35e5ffcef6..dc0fc59586 100644 --- a/tests/test_web_shortener.py +++ b/tests/test_web_shortener.py @@ -5,10 +5,10 @@ import random import sys import unittest - -from trytond.tests.test_tryton import ModuleTestCase, with_transaction -from trytond.tests.test_tryton import suite as test_suite from trytond.pool import Pool +from trytond.tests.test_tryton import ModuleTestCase +from trytond.tests.test_tryton import suite as test_suite +from trytond.tests.test_tryton import with_transaction class WebShortenerTestCase(ModuleTestCase): diff --git a/web.py b/web.py index 33e7c374bb..10772492b8 100644 --- a/web.py +++ b/web.py @@ -1,14 +1,14 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. -import string import logging -from urllib.parse import urljoin, quote +import string +from urllib.parse import quote, urljoin from sql.aggregate import Count from trytond.config import config -from trytond.model import fields, ModelSQL, ModelView +from trytond.model import ModelSQL, ModelView, fields from trytond.pool import Pool from trytond.tools import grouped_slice, reduce_ids from trytond.transaction import Transaction