changeset 33f9065a322f in modules/stock_forecast:default
details: 
https://hg.tryton.org/modules/stock_forecast?cmd=changeset;node=33f9065a322f
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 |  14 +++++++-------
 forecast.py |   4 +++-
 setup.py    |   7 ++++---
 4 files changed, 16 insertions(+), 11 deletions(-)

diffs (72 lines):

diff -r 994ac10456b7 -r 33f9065a322f .flake8
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/.flake8   Sun Mar 01 12:33:54 2020 +0100
@@ -0,0 +1,2 @@
+[flake8]
+ignore=E123,E124,E126,E128,W503
diff -r 994ac10456b7 -r 33f9065a322f __init__.py
--- a/__init__.py       Sat Jan 25 20:18:49 2020 +0100
+++ b/__init__.py       Sun Mar 01 12:33:54 2020 +0100
@@ -2,17 +2,17 @@
 # this repository contains the full copyright notices and license terms.
 
 from trytond.pool import Pool
-from .forecast import *
+from . import forecast
 
 
 def register():
     Pool.register(
-        Forecast,
-        ForecastLine,
-        ForecastLineMove,
-        ForecastCompleteAsk,
-        ForecastCompleteChoose,
+        forecast.Forecast,
+        forecast.ForecastLine,
+        forecast.ForecastLineMove,
+        forecast.ForecastCompleteAsk,
+        forecast.ForecastCompleteChoose,
         module='stock_forecast', type_='model')
     Pool.register(
-        ForecastComplete,
+        forecast.ForecastComplete,
         module='stock_forecast', type_='wizard')
diff -r 994ac10456b7 -r 33f9065a322f forecast.py
--- a/forecast.py       Sat Jan 25 20:18:49 2020 +0100
+++ b/forecast.py       Sun Mar 01 12:33:54 2020 +0100
@@ -381,7 +381,9 @@
         line_move = LineMove.__table__()
 
         result = dict((x.id, 0) for x in lines)
-        key = lambda line: line.forecast.id
+
+        def key(line):
+            return line.forecast.id
         lines.sort(key=key)
         for forecast_id, lines in itertools.groupby(lines, key):
             forecast = Forecast(forecast_id)
diff -r 994ac10456b7 -r 33f9065a322f setup.py
--- a/setup.py  Sat Jan 25 20:18:49 2020 +0100
+++ b/setup.py  Sun Mar 01 12:33:54 2020 +0100
@@ -78,8 +78,8 @@
     keywords='tryton stock forecast',
     package_dir={'trytond.modules.stock_forecast': '.'},
     packages=(
-        ['trytond.modules.stock_forecast'] +
-        ['trytond.modules.stock_forecast.%s' % p for p in find_packages()]
+        ['trytond.modules.stock_forecast']
+        + ['trytond.modules.stock_forecast.%s' % p for p in find_packages()]
         ),
     package_data={
         'trytond.modules.stock_forecast': (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)',

Reply via email to