From b034b09d3a8f95840c8c731b30b67e8fc439247b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sat, 11 Dec 2021 17:58:43 +0100 Subject: [PATCH] Follow isort formatting issue10928 --- .isort.cfg | 3 +++ __init__.py | 3 +-- product.py | 10 +++++----- routes.py | 4 ++-- setup.py | 3 ++- tests/__init__.py | 3 ++- tests/test_product_image.py | 3 ++- 7 files changed, 17 insertions(+), 12 deletions(-) create mode 100644 .isort.cfg 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 97fe05cf5a..22d2f516e4 100644 --- a/__init__.py +++ b/__init__.py @@ -3,8 +3,7 @@ from trytond.pool import Pool -from . import product -from . import routes +from . import product, routes __all__ = ['register', 'routes'] diff --git a/product.py b/product.py index 467a5b0d56..b48712fd60 100644 --- a/product.py +++ b/product.py @@ -2,15 +2,15 @@ # this repository contains the full copyright notices and license terms. import io import math -from urllib.parse import urljoin, quote, urlencode +from urllib.parse import quote, urlencode, urljoin import PIL.Image from trytond.config import config -from trytond.model import ModelSQL, ModelView, MatchMixin, sequence_ordered -from trytond.model import fields, Unique -from trytond.pool import PoolMeta, Pool -from trytond.pyson import Eval, Bool, If +from trytond.model import ( + MatchMixin, ModelSQL, ModelView, Unique, fields, sequence_ordered) +from trytond.pool import Pool, PoolMeta +from trytond.pyson import Bool, Eval, If from trytond.tools import slugify from trytond.transaction import Transaction from trytond.url import http_host diff --git a/routes.py b/routes.py index 9ba4e5ba45..9f8942d7a3 100644 --- a/routes.py +++ b/routes.py @@ -4,15 +4,15 @@ try: from http import HTTPStatus except ImportError: from http import client as HTTPStatus + from urllib.parse import unquote from werkzeug.exceptions import abort from werkzeug.wrappers import Response from trytond.config import config -from trytond.wsgi import app from trytond.protocols.wrappers import with_pool, with_transaction - +from trytond.wsgi import app TIMEOUT = config.getint('product', 'image_timeout', default=365 * 24 * 60 * 60) diff --git a/setup.py b/setup.py index 341980d7df..8de9f3e6bf 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/__init__.py b/tests/__init__.py index d7954285c4..da981b9fa6 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.product_image.tests.test_product_image import suite # noqa: E501 + from trytond.modules.product_image.tests.test_product_image import \ + suite # noqa: E501 except ImportError: from .test_product_image import suite diff --git a/tests/test_product_image.py b/tests/test_product_image.py index 207451b565..c17345a63e 100644 --- a/tests/test_product_image.py +++ b/tests/test_product_image.py @@ -7,8 +7,9 @@ import urllib.request import PIL.Image from trytond.pool import Pool -from trytond.tests.test_tryton import ModuleTestCase, with_transaction +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 ProductImageTestCase(ModuleTestCase):