changeset 40be6bf6d588 in modules/stock_package_shipping_ups:default
details:
https://hg.tryton.org/modules/stock_package_shipping_ups?cmd=changeset;node=40be6bf6d588
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 | 16 ++++++++--------
carrier.py | 2 --
setup.py | 7 ++++---
stock.py | 2 --
tests/__init__.py | 2 +-
6 files changed, 15 insertions(+), 16 deletions(-)
diffs (96 lines):
diff -r d45ae9b7b0d4 -r 40be6bf6d588 .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 d45ae9b7b0d4 -r 40be6bf6d588 __init__.py
--- a/__init__.py Wed Dec 04 11:09:37 2019 +0100
+++ b/__init__.py Sun Mar 01 12:33:54 2020 +0100
@@ -3,18 +3,18 @@
from trytond.pool import Pool
-from .carrier import *
-from .stock import *
+from . import carrier
+from . import stock
def register():
Pool.register(
- PackageType,
- ShipmentOut,
- CredentialUPS,
- Carrier,
+ stock.PackageType,
+ stock.ShipmentOut,
+ carrier.CredentialUPS,
+ carrier.Carrier,
module='stock_package_shipping_ups', type_='model')
Pool.register(
- CreateShipping,
- CreateShippingUPS,
+ stock.CreateShipping,
+ stock.CreateShippingUPS,
module='stock_package_shipping_ups', type_='wizard')
diff -r d45ae9b7b0d4 -r 40be6bf6d588 carrier.py
--- a/carrier.py Wed Dec 04 11:09:37 2019 +0100
+++ b/carrier.py Sun Mar 01 12:33:54 2020 +0100
@@ -4,8 +4,6 @@
from trytond.pool import PoolMeta
from trytond.pyson import Eval
-__all__ = ['CredentialUPS', 'Carrier']
-
class CredentialUPS(ModelSQL, ModelView, MatchMixin):
'UPS Credential'
diff -r d45ae9b7b0d4 -r 40be6bf6d588 setup.py
--- a/setup.py Wed Dec 04 11:09:37 2019 +0100
+++ b/setup.py Sun Mar 01 12:33:54 2020 +0100
@@ -80,8 +80,8 @@
keywords='tryton stock package shipping ups',
package_dir={'trytond.modules.stock_package_shipping_ups': '.'},
packages=(
- ['trytond.modules.stock_package_shipping_ups'] +
- ['trytond.modules.stock_package_shipping_ups.%s' % p
+ ['trytond.modules.stock_package_shipping_ups']
+ + ['trytond.modules.stock_package_shipping_ups.%s' % p
for p in find_packages()]
),
package_data={
@@ -96,7 +96,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 d45ae9b7b0d4 -r 40be6bf6d588 stock.py
--- a/stock.py Wed Dec 04 11:09:37 2019 +0100
+++ b/stock.py Sun Mar 01 12:33:54 2020 +0100
@@ -19,8 +19,6 @@
PackingValidationError)
from .exceptions import UPSError
-__all__ = ['PackageType', 'ShipmentOut', 'CreateShipping', 'CreateShippingUPS']
-
SERVER_URLS = {
'testing': 'https://wwwcie.ups.com/json/Ship',
'production': 'https://onlinetools.ups.com/json/Ship',
diff -r d45ae9b7b0d4 -r 40be6bf6d588 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_package_shipping_ups.tests.test_shipping_ups
import suite
+ from trytond.modules.stock_package_shipping_ups.tests.test_shipping_ups
import suite # noqa: E501
except ImportError:
from .test_shipping_ups import suite