changeset 37273370e742 in modules/dashboard:default
details: https://hg.tryton.org/modules/dashboard?cmd=changeset;node=37273370e742
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  |  12 ++++++------
 dashboard.py |   4 +---
 ir.py        |   2 --
 res.py       |   2 --
 setup.py     |   7 ++++---
 6 files changed, 13 insertions(+), 16 deletions(-)

diffs (93 lines):

diff -r 7d02e04cd467 -r 37273370e742 .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 7d02e04cd467 -r 37273370e742 __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,14 +2,14 @@
 # this repository contains the full copyright notices and license terms.
 
 from trytond.pool import Pool
-from .dashboard import *
-from .res import *
-from .ir import *
+from . import dashboard
+from . import res
+from . import ir
 
 
 def register():
     Pool.register(
-        DashboardAction,
-        User,
-        View,
+        dashboard.Action,
+        res.User,
+        ir.View,
         module='dashboard', type_='model')
diff -r 7d02e04cd467 -r 37273370e742 dashboard.py
--- a/dashboard.py      Wed Dec 04 11:09:35 2019 +0100
+++ b/dashboard.py      Sun Mar 01 12:33:52 2020 +0100
@@ -3,10 +3,8 @@
 from trytond.model import ModelView, ModelSQL, fields, sequence_ordered
 from trytond.pyson import Eval
 
-__all__ = ['DashboardAction']
 
-
-class DashboardAction(sequence_ordered(), ModelSQL, ModelView):
+class Action(sequence_ordered(), ModelSQL, ModelView):
     "Dashboard Action"
     __name__ = "dashboard.action"
     user = fields.Many2One('res.user', 'User', required=True,
diff -r 7d02e04cd467 -r 37273370e742 ir.py
--- a/ir.py     Wed Dec 04 11:09:35 2019 +0100
+++ b/ir.py     Sun Mar 01 12:33:52 2020 +0100
@@ -6,8 +6,6 @@
 from trytond.cache import Cache
 from trytond.pool import Pool, PoolMeta
 
-__all__ = ['View']
-
 
 class View(metaclass=PoolMeta):
     __name__ = 'ir.ui.view'
diff -r 7d02e04cd467 -r 37273370e742 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,8 +3,6 @@
 from trytond.model import fields
 from trytond.pool import PoolMeta
 
-__all__ = ['User']
-
 
 class User(metaclass=PoolMeta):
     __name__ = "res.user"
diff -r 7d02e04cd467 -r 37273370e742 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 dashboard',
     package_dir={'trytond.modules.dashboard': '.'},
     packages=(
-        ['trytond.modules.dashboard'] +
-        ['trytond.modules.dashboard.%s' % p for p in find_packages()]
+        ['trytond.modules.dashboard']
+        + ['trytond.modules.dashboard.%s' % p for p in find_packages()]
         ),
     package_data={
         'trytond.modules.dashboard': (info.get('xml', [])
@@ -91,7 +91,8 @@
         'Framework :: Tryton',
         'Intended Audience :: Developers',
         '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)',

Reply via email to