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
This commit is contained in:
Cédric Krier committed 2020-03-01 12:33:54 +01:00
1 parent 57e22e1e62
commit 56090bb8df
5 files changed
+13 -14

No files matched your search

+2
View File
@@ -0,0 +1,2 @@
[flake8]
ignore=E123,E124,E126,E128,W503
+7 -7
View File
@@ -3,17 +3,17 @@
from trytond.pool import Pool
from .stock import *
from .carrier import *
from . import stock
from . import carrier
def register():
Pool.register(
PackageType,
Package,
ShipmentOut,
Carrier,
stock.PackageType,
stock.Package,
stock.ShipmentOut,
carrier.Carrier,
module='stock_package_shipping', type_='model')
Pool.register(
CreateShipping,
stock.CreateShipping,
module='stock_package_shipping', type_='wizard')
-2
View File
@@ -4,8 +4,6 @@
from trytond.model import fields
from trytond.pool import PoolMeta
__all__ = ['Carrier']
class Carrier(metaclass=PoolMeta):
__name__ = 'carrier'
+4 -3
View File
@@ -80,8 +80,8 @@ setup(name=name,
keywords='tryton stock package shipping',
package_dir={'trytond.modules.stock_package_shipping': '.'},
packages=(
['trytond.modules.stock_package_shipping'] +
['trytond.modules.stock_package_shipping.%s' % p
['trytond.modules.stock_package_shipping']
+ ['trytond.modules.stock_package_shipping.%s' % p
for p in find_packages()]
),
package_data={
@@ -96,7 +96,8 @@ setup(name=name,
'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',
-2
View File
@@ -11,8 +11,6 @@ from trytond.wizard import Wizard, StateTransition
from .exceptions import PackWarning
__all__ = ['PackageType', 'Package', 'ShipmentOut', 'CreateShipping']
class PackageType(metaclass=PoolMeta):
__name__ = 'stock.package.type'