changeset a4eddcae8370 in modules/account_product:default
details:
https://hg.tryton.org/modules/account_product?cmd=changeset;node=a4eddcae8370
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 ++
configuration.py | 3 ---
product.py | 5 -----
setup.py | 7 ++++---
tests/__init__.py | 2 +-
5 files changed, 7 insertions(+), 12 deletions(-)
diffs (70 lines):
diff -r 350594c64865 -r a4eddcae8370 .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 350594c64865 -r a4eddcae8370 configuration.py
--- a/configuration.py Fri Jan 24 00:15:08 2020 +0100
+++ b/configuration.py Sun Mar 01 12:33:51 2020 +0100
@@ -5,9 +5,6 @@
from trytond.pyson import Eval
-__all__ = ['Configuration', 'ConfigurationDefaultAccount']
-
-
class Configuration(metaclass=PoolMeta):
__name__ = 'account.configuration'
diff -r 350594c64865 -r a4eddcae8370 product.py
--- a/product.py Fri Jan 24 00:15:08 2020 +0100
+++ b/product.py Sun Mar 01 12:33:51 2020 +0100
@@ -16,11 +16,6 @@
from .exceptions import AccountError, TaxError
-__all__ = ['Category', 'CategoryAccount',
- 'CategoryCustomerTax', 'CategorySupplierTax',
- 'Template', 'Product', 'account_used', 'template_property',
- 'TemplateAccountCategory', 'TemplateCategoryAll']
-
def account_used(field_name, field_string=None):
if field_string is None:
diff -r 350594c64865 -r a4eddcae8370 setup.py
--- a/setup.py Fri Jan 24 00:15:08 2020 +0100
+++ b/setup.py Sun Mar 01 12:33:51 2020 +0100
@@ -79,8 +79,8 @@
keywords='tryton account product',
package_dir={'trytond.modules.account_product': '.'},
packages=(
- ['trytond.modules.account_product'] +
- ['trytond.modules.account_product.%s' % p for p in find_packages()]
+ ['trytond.modules.account_product']
+ + ['trytond.modules.account_product.%s' % p for p in find_packages()]
),
package_data={
'trytond.modules.account_product': (info.get('xml', [])
@@ -93,7 +93,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 350594c64865 -r a4eddcae8370 tests/__init__.py
--- a/tests/__init__.py Fri Jan 24 00:15:08 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_product.tests.test_account_product import
suite
+ from trytond.modules.account_product.tests.test_account_product import
suite # noqa: E501
except ImportError:
from .test_account_product import suite