changeset bd1639d01bb0 in modules/stock_package:default
details:
https://hg.tryton.org/modules/stock_package?cmd=changeset;node=bd1639d01bb0
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 | 18 +++++++++---------
setup.py | 7 ++++---
stock.py | 3 ---
4 files changed, 15 insertions(+), 15 deletions(-)
diffs (75 lines):
diff -r fe68cae2d8ff -r bd1639d01bb0 .flake8
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/.flake8 Sun Mar 01 12:33:54 2020 +0100
@@ -0,0 +1,2 @@
+[flake8]
+ignore=E123,E124,E126,E128,W503
diff -r fe68cae2d8ff -r bd1639d01bb0 __init__.py
--- a/__init__.py Fri Dec 06 17:33:47 2019 +0100
+++ b/__init__.py Sun Mar 01 12:33:54 2020 +0100
@@ -2,19 +2,19 @@
# this repository contains the full copyright notices and license terms.
from trytond.pool import Pool
-from .stock import *
+from . import stock
def register():
Pool.register(
- Configuration,
- ConfigurationSequence,
- Type,
- Package,
- Move,
- ShipmentOut,
- ShipmentInReturn,
+ stock.Configuration,
+ stock.ConfigurationSequence,
+ stock.Type,
+ stock.Package,
+ stock.Move,
+ stock.ShipmentOut,
+ stock.ShipmentInReturn,
module='stock_package', type_='model')
Pool.register(
- PackageLabel,
+ stock.PackageLabel,
module='stock_package', type_='report')
diff -r fe68cae2d8ff -r bd1639d01bb0 setup.py
--- a/setup.py Fri Dec 06 17:33:47 2019 +0100
+++ b/setup.py Sun Mar 01 12:33:54 2020 +0100
@@ -79,8 +79,8 @@
keywords='tryton stock packaging',
package_dir={'trytond.modules.stock_package': '.'},
packages=(
- ['trytond.modules.stock_package'] +
- ['trytond.modules.stock_package.%s' % p for p in find_packages()]
+ ['trytond.modules.stock_package']
+ + ['trytond.modules.stock_package.%s' % p for p in find_packages()]
),
package_data={
'trytond.modules.stock_package': (info.get('xml', [])
@@ -95,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)',
diff -r fe68cae2d8ff -r bd1639d01bb0 stock.py
--- a/stock.py Fri Dec 06 17:33:47 2019 +0100
+++ b/stock.py Sun Mar 01 12:33:54 2020 +0100
@@ -9,9 +9,6 @@
from .exceptions import PackageError
-__all__ = ['Configuration', 'ConfigurationSequence', 'Package', 'Type', 'Move',
- 'ShipmentOut', 'ShipmentInReturn', 'PackageLabel']
-
class Configuration(metaclass=PoolMeta):
__name__ = 'stock.configuration'