changeset f8780c045a59 in modules/account_stock_continental:default
details:
https://hg.tryton.org/modules/account_stock_continental?cmd=changeset;node=f8780c045a59
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 ++
setup.py | 7 ++++---
stock.py | 5 ++---
tests/__init__.py | 2 +-
4 files changed, 9 insertions(+), 7 deletions(-)
diffs (64 lines):
diff -r c828d3afdd9f -r f8780c045a59 .flake8
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/.flake8 Sun Mar 01 12:33:51 2020 +0100
@@ -0,0 +1,2 @@
+[flake8]
+ignore=E123,E124,E126,E128,W503
diff -r c828d3afdd9f -r f8780c045a59 setup.py
--- a/setup.py Sun Jan 26 21:10:40 2020 +0100
+++ b/setup.py Sun Mar 01 12:33:51 2020 +0100
@@ -83,8 +83,8 @@
keywords='tryton account stock valuation continental',
package_dir={'trytond.modules.account_stock_continental': '.'},
packages=(
- ['trytond.modules.account_stock_continental'] +
- ['trytond.modules.account_stock_continental.%s' % p
+ ['trytond.modules.account_stock_continental']
+ + ['trytond.modules.account_stock_continental.%s' % p
for p in find_packages()]
),
package_data={
@@ -98,7 +98,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 :: Chinese (Simplified)',
diff -r c828d3afdd9f -r f8780c045a59 stock.py
--- a/stock.py Sun Jan 26 21:10:40 2020 +0100
+++ b/stock.py Sun Mar 01 12:33:51 2020 +0100
@@ -6,8 +6,6 @@
from trytond.pool import Pool, PoolMeta
from trytond.transaction import Transaction
-__all__ = ['Move']
-
class Move(metaclass=PoolMeta):
__name__ = 'stock.move'
@@ -24,7 +22,8 @@
'wrong type'
move_line = AccountMoveLine()
- if ((type_.endswith('supplier')
+ if ((
+ type_.endswith('supplier')
or type_ == 'in_production')
and self.product.cost_price_method != 'fixed'):
with Transaction().set_context(date=self.effective_date):
diff -r c828d3afdd9f -r f8780c045a59 tests/__init__.py
--- a/tests/__init__.py Sun Jan 26 21:10:40 2020 +0100
+++ b/tests/__init__.py Sun Mar 01 12:33:51 2020 +0100
@@ -2,7 +2,7 @@
# this repository contains the full copyright notices and license terms.
try:
- from
trytond.modules.account_stock_continental.tests.test_account_stock_continental
import suite
+ from
trytond.modules.account_stock_continental.tests.test_account_stock_continental
import suite # noqa: E501
except ImportError:
from .test_account_stock_continental import suite