changeset 08648216eda6 in modules/company_work_time:default
details:
https://hg.tryton.org/modules/company_work_time?cmd=changeset;node=08648216eda6
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 | 8 ++++----
company.py | 3 ---
res.py | 3 ---
setup.py | 7 ++++---
tests/__init__.py | 2 +-
6 files changed, 11 insertions(+), 14 deletions(-)
diffs (88 lines):
diff -r 6f28ecc5c053 -r 08648216eda6 .flake8
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/.flake8 Sun Mar 01 12:33:52 2020 +0100
@@ -0,0 +1,2 @@
+[flake8]
+ignore=E123,E124,E126,E128,W503
diff -r 6f28ecc5c053 -r 08648216eda6 __init__.py
--- a/__init__.py Wed Dec 04 11:09:35 2019 +0100
+++ b/__init__.py Sun Mar 01 12:33:52 2020 +0100
@@ -2,12 +2,12 @@
# this repository contains the full copyright notices and license terms.
from trytond.pool import Pool
-from .company import *
-from .res import *
+from . import company
+from . import res
def register():
Pool.register(
- Company,
- User,
+ company.Company,
+ res.User,
module='company_work_time', type_='model')
diff -r 6f28ecc5c053 -r 08648216eda6 company.py
--- a/company.py Wed Dec 04 11:09:35 2019 +0100
+++ b/company.py Sun Mar 01 12:33:52 2020 +0100
@@ -4,9 +4,6 @@
from trytond.pool import PoolMeta, Pool
-__all__ = ['Company']
-
-
class Company(metaclass=PoolMeta):
__name__ = 'company.company'
diff -r 6f28ecc5c053 -r 08648216eda6 res.py
--- a/res.py Wed Dec 04 11:09:35 2019 +0100
+++ b/res.py Sun Mar 01 12:33:52 2020 +0100
@@ -3,9 +3,6 @@
from trytond.pool import PoolMeta
-__all__ = ['User']
-
-
class User(metaclass=PoolMeta):
__name__ = 'res.user'
diff -r 6f28ecc5c053 -r 08648216eda6 setup.py
--- a/setup.py Wed Dec 04 11:09:35 2019 +0100
+++ b/setup.py Sun Mar 01 12:33:52 2020 +0100
@@ -78,8 +78,8 @@
keywords='tryton company work time',
package_dir={'trytond.modules.company_work_time': '.'},
packages=(
- ['trytond.modules.company_work_time'] +
- ['trytond.modules.company_work_time.%s' % p for p in find_packages()]
+ ['trytond.modules.company_work_time']
+ + ['trytond.modules.company_work_time.%s' % p for p in find_packages()]
),
package_data={
'trytond.modules.company_work_time': (info.get('xml', [])
@@ -93,7 +93,8 @@
'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)',
diff -r 6f28ecc5c053 -r 08648216eda6 tests/__init__.py
--- a/tests/__init__.py Wed Dec 04 11:09:35 2019 +0100
+++ b/tests/__init__.py Sun Mar 01 12:33:52 2020 +0100
@@ -2,7 +2,7 @@
# this repository contains the full copyright notices and license terms.
try:
- from trytond.modules.company_work_time.tests.test_company_work_time import
suite
+ from trytond.modules.company_work_time.tests.test_company_work_time import
suite # noqa: E501
except ImportError:
from .test_company_work_time import suite