changeset f743b70c2f41 in modules/stock_location_sequence:default
details:
https://hg.tryton.org/modules/stock_location_sequence?cmd=changeset;node=f743b70c2f41
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 | 4 ++--
setup.py | 7 ++++---
stock.py | 3 ---
tests/__init__.py | 2 +-
5 files changed, 9 insertions(+), 9 deletions(-)
diffs (73 lines):
diff -r 6a1d0e1d17b5 -r f743b70c2f41 .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 6a1d0e1d17b5 -r f743b70c2f41 __init__.py
--- a/__init__.py Wed Dec 04 11:09:37 2019 +0100
+++ b/__init__.py Sun Mar 01 12:33:54 2020 +0100
@@ -2,10 +2,10 @@
# 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(
- Location,
+ stock.Location,
module='stock_location_sequence', type_='model')
diff -r 6a1d0e1d17b5 -r f743b70c2f41 setup.py
--- a/setup.py Wed Dec 04 11:09:37 2019 +0100
+++ b/setup.py Sun Mar 01 12:33:54 2020 +0100
@@ -78,8 +78,8 @@
keywords='tryton stock location sequence',
package_dir={'trytond.modules.stock_location_sequence': '.'},
packages=(
- ['trytond.modules.stock_location_sequence'] +
- ['trytond.modules.stock_location_sequence.%s' % p
+ ['trytond.modules.stock_location_sequence']
+ + ['trytond.modules.stock_location_sequence.%s' % p
for p in find_packages()]
),
package_data={
@@ -94,7 +94,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 6a1d0e1d17b5 -r f743b70c2f41 stock.py
--- a/stock.py Wed Dec 04 11:09:37 2019 +0100
+++ b/stock.py Sun Mar 01 12:33:54 2020 +0100
@@ -4,11 +4,8 @@
from trytond.pyson import Eval, Bool
from trytond.pool import PoolMeta
-__all__ = ['Location']
-
class Location(sequence_ordered(), metaclass=PoolMeta):
- "Stock Location"
__name__ = 'stock.location'
@classmethod
diff -r 6a1d0e1d17b5 -r f743b70c2f41 tests/__init__.py
--- a/tests/__init__.py Wed Dec 04 11:09:37 2019 +0100
+++ b/tests/__init__.py Sun Mar 01 12:33:54 2020 +0100
@@ -2,7 +2,7 @@
# this repository contains the full copyright notices and license terms.
try:
- from
trytond.modules.stock_location_sequence.tests.test_stock_location_sequence
import suite
+ from
trytond.modules.stock_location_sequence.tests.test_stock_location_sequence
import suite # noqa: E501
except ImportError:
from .test_stock_location_sequence import suite