changeset 4966c327e36f in modules/product_classification_taxonomic:default
details: 
https://hg.tryton.org/modules/product_classification_taxonomic?cmd=changeset;node=4966c327e36f
description:
        Fix flake8 errors and warnings

        We add the flake8 configuration used so we ensure everyone uses the 
same.
        We remove the usage of __all__ for non public API.
        When possible, we rationalize the class name according to its __name__ 
and module.

        issue9082
        review297061002
diffstat:

 .flake8           |   2 ++
 __init__.py       |  12 ++++++------
 product.py        |   3 ---
 setup.py          |   9 +++++----
 tests/__init__.py |   2 +-
 5 files changed, 14 insertions(+), 14 deletions(-)

diffs (88 lines):

diff -r 0ef9b41f9a2f -r 4966c327e36f .flake8
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/.flake8   Sun Mar 01 12:33:52 2020 +0100
@@ -0,0 +1,2 @@
+[flake8]
+ignore=E123,E124,E126,E128,W503
diff -r 0ef9b41f9a2f -r 4966c327e36f __init__.py
--- a/__init__.py       Wed Dec 04 11:09:36 2019 +0100
+++ b/__init__.py       Sun Mar 01 12:33:52 2020 +0100
@@ -2,14 +2,14 @@
 # this repository contains the full copyright notices and license terms.
 
 from trytond.pool import Pool
-from .product import *
+from . import product
 
 
 def register():
     Pool.register(
-        Template,
-        Taxon,
-        Cultivar,
-        CultivarGroup,
-        Cultivar_CultivarGroup,
+        product.Template,
+        product.Taxon,
+        product.Cultivar,
+        product.CultivarGroup,
+        product.Cultivar_CultivarGroup,
         module='product_classification_taxonomic', type_='model')
diff -r 0ef9b41f9a2f -r 4966c327e36f product.py
--- a/product.py        Wed Dec 04 11:09:36 2019 +0100
+++ b/product.py        Sun Mar 01 12:33:52 2020 +0100
@@ -6,9 +6,6 @@
 from trytond.modules.product_classification.product import (
     classification_tree, ClassificationMixin)
 
-__all__ = ['Template',
-    'Taxon', 'Cultivar', 'CultivarGroup', 'Cultivar_CultivarGroup']
-
 
 class Template(metaclass=PoolMeta):
     __name__ = 'product.template'
diff -r 0ef9b41f9a2f -r 4966c327e36f setup.py
--- a/setup.py  Wed Dec 04 11:09:36 2019 +0100
+++ b/setup.py  Sun Mar 01 12:33:52 2020 +0100
@@ -79,8 +79,8 @@
     keywords='tryton product classification taxonomic',
     package_dir={'trytond.modules.product_classification_taxonomic': '.'},
     packages=(
-        ['trytond.modules.product_classification_taxonomic'] +
-        ['trytond.modules.product_classification_taxonomic.%s' % p
+        ['trytond.modules.product_classification_taxonomic']
+        + ['trytond.modules.product_classification_taxonomic.%s' % p
             for p in find_packages()]
         ),
     package_data={
@@ -93,7 +93,8 @@
         'Environment :: Plugins',
         'Framework :: Tryton',
         'Intended Audience :: Developers',
-        'License :: OSI Approved :: GNU General Public License v3 or later 
(GPLv3+)',
+        'License :: OSI Approved :: '
+        'GNU General Public License v3 or later (GPLv3+)',
         'Natural Language :: Bulgarian',
         'Natural Language :: Catalan',
         'Natural Language :: Chinese (Simplified)',
@@ -130,7 +131,7 @@
     entry_points="""
     [trytond.modules]
     product_classification_taxonomic = 
trytond.modules.product_classification_taxonomic
-    """,
+    """,  # noqa: E501
     test_suite='tests',
     test_loader='trytond.test_loader:Loader',
     )
diff -r 0ef9b41f9a2f -r 4966c327e36f tests/__init__.py
--- a/tests/__init__.py Wed Dec 04 11:09:36 2019 +0100
+++ b/tests/__init__.py Sun Mar 01 12:33:52 2020 +0100
@@ -2,7 +2,7 @@
 # this repository contains the full copyright notices and license terms.
 
 try:
-    from 
trytond.modules.product_classification_taxonomic.tests.test_product_classification_taxonomic
 import suite
+    from 
trytond.modules.product_classification_taxonomic.tests.test_product_classification_taxonomic
 import suite  # noqa: E501
 except ImportError:
     from .test_product_classification_taxonomic import suite
 

Reply via email to