changeset 1a2f48fdd77f in modules/account_stock_anglo_saxon:default
details:
https://hg.tryton.org/modules/account_stock_anglo_saxon?cmd=changeset;node=1a2f48fdd77f
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 ++
account.py | 2 --
invoice.py | 2 --
product.py | 2 --
setup.py | 7 ++++---
stock.py | 2 --
tests/__init__.py | 2 +-
7 files changed, 7 insertions(+), 12 deletions(-)
diffs (90 lines):
diff -r df7cddd187d8 -r 1a2f48fdd77f .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 df7cddd187d8 -r 1a2f48fdd77f account.py
--- a/account.py Wed Jan 08 14:36:45 2020 +0100
+++ b/account.py Sun Mar 01 12:33:51 2020 +0100
@@ -2,8 +2,6 @@
# this repository contains the full copyright notices and license terms.
from trytond.pool import PoolMeta
-__all__ = ['FiscalYear']
-
class FiscalYear(metaclass=PoolMeta):
__name__ = 'account.fiscalyear'
diff -r df7cddd187d8 -r 1a2f48fdd77f invoice.py
--- a/invoice.py Wed Jan 08 14:36:45 2020 +0100
+++ b/invoice.py Sun Mar 01 12:33:51 2020 +0100
@@ -9,8 +9,6 @@
from .exceptions import COGSWarning
-__all__ = ['InvoiceLine']
-
class InvoiceLine(metaclass=PoolMeta):
__name__ = 'account.invoice.line'
diff -r df7cddd187d8 -r 1a2f48fdd77f product.py
--- a/product.py Wed Jan 08 14:36:45 2020 +0100
+++ b/product.py Sun Mar 01 12:33:51 2020 +0100
@@ -8,8 +8,6 @@
from trytond.modules.account_product.product import (
account_used, template_property)
-__all__ = ['Category', 'CategoryAccount', 'Template', 'Product']
-
class Category(metaclass=PoolMeta):
__name__ = 'product.category'
diff -r df7cddd187d8 -r 1a2f48fdd77f setup.py
--- a/setup.py Wed Jan 08 14:36:45 2020 +0100
+++ b/setup.py Sun Mar 01 12:33:51 2020 +0100
@@ -83,8 +83,8 @@
keywords='tryton account stock valuation anglo-saxon',
package_dir={'trytond.modules.account_stock_anglo_saxon': '.'},
packages=(
- ['trytond.modules.account_stock_anglo_saxon'] +
- ['trytond.modules.account_stock_anglo_saxon.%s' % p
+ ['trytond.modules.account_stock_anglo_saxon']
+ + ['trytond.modules.account_stock_anglo_saxon.%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 df7cddd187d8 -r 1a2f48fdd77f stock.py
--- a/stock.py Wed Jan 08 14:36:45 2020 +0100
+++ b/stock.py Sun Mar 01 12:33:51 2020 +0100
@@ -5,8 +5,6 @@
from trytond.pool import Pool, PoolMeta
from trytond.transaction import Transaction
-__all__ = ['Move']
-
def _get_field(type_):
if type_.startswith('in_'):
diff -r df7cddd187d8 -r 1a2f48fdd77f tests/__init__.py
--- a/tests/__init__.py Wed Jan 08 14:36:45 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_anglo_saxon.tests.test_account_stock_anglo_saxon
import suite
+ from
trytond.modules.account_stock_anglo_saxon.tests.test_account_stock_anglo_saxon
import suite # noqa: E501
except ImportError:
from .test_account_stock_anglo_saxon import suite