changeset 46478483d9a6 in modules/production_routing:default
details:
https://hg.tryton.org/modules/production_routing?cmd=changeset;node=46478483d9a6
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 | 20 ++++++++++----------
product.py | 2 --
production.py | 2 --
routing.py | 4 +---
setup.py | 8 +++++---
6 files changed, 18 insertions(+), 20 deletions(-)
diffs (108 lines):
diff -r 985da53e0723 -r 46478483d9a6 .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 985da53e0723 -r 46478483d9a6 __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,18 +2,18 @@
# this repository contains the full copyright notices and license terms.
from trytond.pool import Pool
-from .routing import *
-from .production import *
-from .product import *
+from . import routing
+from . import production
+from . import product
def register():
Pool.register(
- Routing,
- Operation,
- RoutingStep,
- Routing_BOM,
- Production,
- ProductBom,
- ProductionLeadTime,
+ routing.Routing,
+ routing.RoutingOperation,
+ routing.RoutingStep,
+ routing.Routing_BOM,
+ production.Production,
+ product.ProductBom,
+ product.ProductionLeadTime,
module='production_routing', type_='model')
diff -r 985da53e0723 -r 46478483d9a6 product.py
--- a/product.py Wed Dec 04 11:09:36 2019 +0100
+++ b/product.py Sun Mar 01 12:33:52 2020 +0100
@@ -4,8 +4,6 @@
from trytond.model import fields
from trytond.pyson import Eval
-__all__ = ['ProductBom', 'ProductionLeadTime']
-
class ProductBom(metaclass=PoolMeta):
__name__ = 'product.product-production.bom'
diff -r 985da53e0723 -r 46478483d9a6 production.py
--- a/production.py Wed Dec 04 11:09:36 2019 +0100
+++ b/production.py Sun Mar 01 12:33:52 2020 +0100
@@ -4,8 +4,6 @@
from trytond.model import fields
from trytond.pyson import Eval
-__all__ = ['Production']
-
class Production(metaclass=PoolMeta):
__name__ = 'production'
diff -r 985da53e0723 -r 46478483d9a6 routing.py
--- a/routing.py Wed Dec 04 11:09:36 2019 +0100
+++ b/routing.py Sun Mar 01 12:33:52 2020 +0100
@@ -3,8 +3,6 @@
from trytond.model import (
ModelSQL, ModelView, DeactivableMixin, fields, sequence_ordered)
-__all__ = ['Routing', 'Operation', 'RoutingStep', 'Routing_BOM']
-
class Routing(DeactivableMixin, ModelSQL, ModelView):
'Routing'
@@ -15,7 +13,7 @@
'production.routing-production.bom', 'routing', 'bom', 'BOMs')
-class Operation(DeactivableMixin, ModelSQL, ModelView):
+class RoutingOperation(DeactivableMixin, ModelSQL, ModelView):
'Operation'
__name__ = 'production.routing.operation'
name = fields.Char('Operation', required=True, translate=True)
diff -r 985da53e0723 -r 46478483d9a6 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,9 @@
keywords='tryton production routing',
package_dir={'trytond.modules.production_routing': '.'},
packages=(
- ['trytond.modules.production_routing'] +
- ['trytond.modules.production_routing.%s' % p for p in find_packages()]
+ ['trytond.modules.production_routing']
+ + ['trytond.modules.production_routing.%s' % p
+ for p in find_packages()]
),
package_data={
'trytond.modules.production_routing': (info.get('xml', [])
@@ -94,7 +95,8 @@
'Intended Audience :: Financial and Insurance Industry',
'Intended Audience :: Legal Industry',
'Intended Audience :: Manufacturing',
- '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)',