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:53 +01:00
1 parent da8c3671ab
commit 438448570a
6 files changed
+9 -10

No files matched your search

+2
View File
@@ -0,0 +1,2 @@
[flake8]
ignore=E123,E124,E126,E128,W503
+1 -1
View File
@@ -11,6 +11,6 @@ def register():
work.Work,
module='project_revenue', type_='model')
Pool.register(
purchase.PurchaseLine,
purchase.Line,
module='project_revenue', type_='model',
depends=['purchase'])
+1 -3
View File
@@ -4,10 +4,8 @@ from trytond.pool import PoolMeta
from trytond.model import fields
from trytond.pyson import Eval
__all__ = ['PurchaseLine']
class PurchaseLine(metaclass=PoolMeta):
class Line(metaclass=PoolMeta):
__name__ = 'purchase.line'
work = fields.Many2One('project.work', 'Work Effort', select=True,
+4 -3
View File
@@ -80,8 +80,8 @@ setup(name=name,
keywords='tryton project revenue',
package_dir={'trytond.modules.project_revenue': '.'},
packages=(
['trytond.modules.project_revenue'] +
['trytond.modules.project_revenue.%s' % p for p in find_packages()]
['trytond.modules.project_revenue']
+ ['trytond.modules.project_revenue.%s' % p for p in find_packages()]
),
package_data={
'trytond.modules.project_revenue': (info.get('xml', [])
@@ -95,7 +95,8 @@ setup(name=name,
'Intended Audience :: Financial and Insurance Industry',
'Intended Audience :: Legal Industry',
'Intended Audience :: Manufacturing',
'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)',
+1 -1
View File
@@ -2,7 +2,7 @@
# this repository contains the full copyright notices and license terms.
try:
from trytond.modules.project_revenue.tests.test_project_revenue import suite
from trytond.modules.project_revenue.tests.test_project_revenue import suite # noqa: E501
except ImportError:
from .test_project_revenue import suite
-2
View File
@@ -14,8 +14,6 @@ from trytond.tools import reduce_ids, grouped_slice
from trytond.modules.product import price_digits
__all__ = ['Work']
class Work(metaclass=PoolMeta):
__name__ = 'project.work'