changeset 977399b87312 in modules/production_split:default
details: 
https://hg.tryton.org/modules/production_split?cmd=changeset;node=977399b87312
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       |  8 ++++----
 production.py     |  2 --
 setup.py          |  8 +++++---
 tests/__init__.py |  2 +-
 5 files changed, 12 insertions(+), 10 deletions(-)

diffs (77 lines):

diff -r 7aeee03795ae -r 977399b87312 .flake8
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/.flake8   Sun Mar 01 12:33:53 2020 +0100
@@ -0,0 +1,2 @@
+[flake8]
+ignore=E123,E124,E126,E128,W503
diff -r 7aeee03795ae -r 977399b87312 __init__.py
--- a/__init__.py       Wed Dec 04 11:09:36 2019 +0100
+++ b/__init__.py       Sun Mar 01 12:33:53 2020 +0100
@@ -3,14 +3,14 @@
 
 from trytond.pool import Pool
 
-from .production import *
+from . import production
 
 
 def register():
     Pool.register(
-        Production,
-        SplitProductionStart,
+        production.Production,
+        production.SplitProductionStart,
         module='production_split', type_='model')
     Pool.register(
-        SplitProduction,
+        production.SplitProduction,
         module='production_split', type_='wizard')
diff -r 7aeee03795ae -r 977399b87312 production.py
--- a/production.py     Wed Dec 04 11:09:36 2019 +0100
+++ b/production.py     Sun Mar 01 12:33:53 2020 +0100
@@ -6,8 +6,6 @@
 from trytond.transaction import Transaction
 from trytond.wizard import Wizard, StateView, StateTransition, Button
 
-__all__ = ['Production', 'SplitProduction', 'SplitProductionStart']
-
 
 class Production(metaclass=PoolMeta):
     __name__ = 'production'
diff -r 7aeee03795ae -r 977399b87312 setup.py
--- a/setup.py  Wed Dec 04 11:09:36 2019 +0100
+++ b/setup.py  Sun Mar 01 12:33:53 2020 +0100
@@ -79,8 +79,9 @@
     keywords='tryton production split',
     package_dir={'trytond.modules.production_split': '.'},
     packages=(
-        ['trytond.modules.production_split'] +
-        ['trytond.modules.production_split.%s' % p for p in find_packages()]
+        ['trytond.modules.production_split']
+        + ['trytond.modules.production_split.%s' % p
+            for p in find_packages()]
         ),
     package_data={
         'trytond.modules.production_split': (info.get('xml', [])
@@ -94,7 +95,8 @@
         'Intended Audience :: Developers',
         'Intended Audience :: Financial and Insurance Industry',
         'Intended Audience :: Legal Industry',
-        '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 :: Czech',
diff -r 7aeee03795ae -r 977399b87312 tests/__init__.py
--- a/tests/__init__.py Wed Dec 04 11:09:36 2019 +0100
+++ b/tests/__init__.py Sun Mar 01 12:33:53 2020 +0100
@@ -2,7 +2,7 @@
 # this repository contains the full copyright notices and license terms.
 
 try:
-    from trytond.modules.production_split.tests.test_production_split import 
suite
+    from trytond.modules.production_split.tests.test_production_split import 
suite  # noqa: E501
 except ImportError:
     from .test_production_split import suite
 

Reply via email to