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 5f131272d6..5fc9b58edc 100644 --- a/__init__.py +++ b/__init__.py @@ -2,10 +2,8 @@ # this repository contains the full copyright notices and license terms. from trytond.pool import Pool -from . import account -from . import ir -from . import party -from . import routes + +from . import account, ir, party, routes __all__ = ['register', 'routes'] diff --git a/account.py b/account.py index ba1c05f588..482243f0cf 100644 --- a/account.py +++ b/account.py @@ -5,25 +5,24 @@ import urllib import uuid import braintree -from braintree.exceptions import TooManyRequestsError, GatewayTimeoutError +from braintree.exceptions import GatewayTimeoutError, TooManyRequestsError from braintree.exceptions.braintree_error import BraintreeError from trytond.cache import Cache from trytond.config import config from trytond.i18n import gettext from trytond.model import ( - ModelSQL, ModelView, DeactivableMixin, Workflow, fields) -from trytond.pool import PoolMeta, Pool -from trytond.pyson import Eval, Bool + DeactivableMixin, ModelSQL, ModelView, Workflow, fields) +from trytond.modules.account_payment.exceptions import ( + PaymentValidationError, ProcessError) +from trytond.modules.currency.fields import Monetary +from trytond.pool import Pool, PoolMeta +from trytond.pyson import Bool, Eval from trytond.report import Report from trytond.transaction import Transaction from trytond.url import http_host from trytond.wizard import ( - Wizard, StateAction, StateView, StateTransition, Button) - -from trytond.modules.account_payment.exceptions import ( - ProcessError, PaymentValidationError) -from trytond.modules.currency.fields import Monetary + Button, StateAction, StateTransition, StateView, Wizard) from .common import BraintreeCustomerMethodMixin diff --git a/party.py b/party.py index ed85ddf4e7..b370f8341b 100644 --- a/party.py +++ b/party.py @@ -1,7 +1,7 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. -from trytond.pool import PoolMeta, Pool from trytond.model import fields +from trytond.pool import Pool, PoolMeta from .common import BraintreeCustomerMethodMixin diff --git a/routes.py b/routes.py index f75148783d..2346e3c575 100644 --- a/routes.py +++ b/routes.py @@ -2,6 +2,7 @@ # this repository contains the full copyright notices and license terms. import http.client import logging + try: from http import HTTPStatus except ImportError: diff --git a/setup.py b/setup.py index 15921e3548..8d5a6190c4 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, slice=None): diff --git a/tests/__init__.py b/tests/__init__.py index 9bee44bda6..bb17288e43 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -2,7 +2,8 @@ # this repository contains the full copyright notices and license terms. try: - from trytond.modules.account_payment_braintree.tests.test_account_payment_braintree import suite # noqa: E501 + from trytond.modules.account_payment_braintree.tests.test_account_payment_braintree import \ + suite # noqa: E501 except ImportError: from .test_account_payment_braintree import suite diff --git a/tests/test_account_payment_braintree.py b/tests/test_account_payment_braintree.py index fb2b5a0956..fc8247fbcf 100644 --- a/tests/test_account_payment_braintree.py +++ b/tests/test_account_payment_braintree.py @@ -1,14 +1,12 @@ # 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 doctest import os import unittest -import doctest - -from trytond.tests.test_tryton import ModuleTestCase +from trytond.tests.test_tryton import ( + ModuleTestCase, doctest_checker, doctest_teardown) from trytond.tests.test_tryton import suite as test_suite -from trytond.tests.test_tryton import doctest_teardown -from trytond.tests.test_tryton import doctest_checker class AccountPaymentBraintreeTestCase(ModuleTestCase):