changeset d9825b10abef in modules/stock_supply:default
details: 
https://hg.tryton.org/modules/stock_supply?cmd=changeset;node=d9825b10abef
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         |  32 ++++++++++++++++----------------
 location.py         |   3 ---
 order_point.py      |   6 ++----
 product.py          |   2 --
 purchase_request.py |   2 --
 setup.py            |   7 ++++---
 shipment.py         |   2 --
 stock.py            |   6 ++----
 9 files changed, 26 insertions(+), 36 deletions(-)

diffs (179 lines):

diff -r 320fda524e14 -r d9825b10abef .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 320fda524e14 -r d9825b10abef __init__.py
--- a/__init__.py       Wed Dec 04 11:09:37 2019 +0100
+++ b/__init__.py       Sun Mar 01 12:33:54 2020 +0100
@@ -2,27 +2,27 @@
 # this repository contains the full copyright notices and license terms.
 
 from trytond.pool import Pool
-from .order_point import *
-from .product import *
-from .purchase_request import *
-from .shipment import *
-from .location import *
+from . import order_point
+from . import product
+from . import purchase_request
+from . import shipment
+from . import location
 from . import stock
 
 
 def register():
     Pool.register(
-        OrderPoint,
-        Product,
-        ProductSupplier,
-        PurchaseConfiguration,
-        PurchaseConfigurationSupplyPeriod,
-        PurchaseRequest,
-        ShipmentInternal,
-        Location,
-        LocationLeadTime,
-        stock.StockSupplyStart,
+        order_point.OrderPoint,
+        product.Product,
+        product.ProductSupplier,
+        purchase_request.PurchaseConfiguration,
+        purchase_request.PurchaseConfigurationSupplyPeriod,
+        purchase_request.PurchaseRequest,
+        shipment.ShipmentInternal,
+        location.Location,
+        location.LocationLeadTime,
+        stock.SupplyStart,
         module='stock_supply', type_='model')
     Pool.register(
-        stock.StockSupply,
+        stock.Supply,
         module='stock_supply', type_='wizard')
diff -r 320fda524e14 -r d9825b10abef location.py
--- a/location.py       Wed Dec 04 11:09:37 2019 +0100
+++ b/location.py       Sun Mar 01 12:33:54 2020 +0100
@@ -7,9 +7,6 @@
 from trytond.pyson import Eval
 
 
-__all__ = ['Location', 'LocationLeadTime']
-
-
 class Location(metaclass=PoolMeta):
     __name__ = 'stock.location'
 
diff -r 320fda524e14 -r d9825b10abef order_point.py
--- a/order_point.py    Wed Dec 04 11:09:37 2019 +0100
+++ b/order_point.py    Sun Mar 01 12:33:54 2020 +0100
@@ -9,8 +9,6 @@
 
 from .exceptions import OrderPointValidationError
 
-__all__ = ['OrderPoint']
-
 
 class OrderPoint(ModelSQL, ModelView):
     """
@@ -53,7 +51,7 @@
         states={
             'invisible': Not(Equal(Eval('type'), 'internal')),
             'required': ((Eval('type') == 'internal')
-                & (Eval('min_quantity', None) != None)),
+                & (Eval('min_quantity', None) != None)),  # noqa: E711
         },
         depends=['type', 'min_quantity'])
     overflowing_location = fields.Many2One(
@@ -62,7 +60,7 @@
         states={
             'invisible': Eval('type') != 'internal',
             'required': ((Eval('type') == 'internal')
-                & (Eval('max_quantity', None) != None)),
+                & (Eval('max_quantity', None) != None)),  # noqa: E711
             },
         depends=['type', 'max_quantity'])
     type = fields.Selection(
diff -r 320fda524e14 -r d9825b10abef product.py
--- a/product.py        Wed Dec 04 11:09:37 2019 +0100
+++ b/product.py        Sun Mar 01 12:33:54 2020 +0100
@@ -5,8 +5,6 @@
 from trytond.model import fields
 from trytond.pool import PoolMeta, Pool
 
-__all__ = ['Product', 'ProductSupplier']
-
 
 class Product(metaclass=PoolMeta):
     __name__ = "product.product"
diff -r 320fda524e14 -r d9825b10abef purchase_request.py
--- a/purchase_request.py       Wed Dec 04 11:09:37 2019 +0100
+++ b/purchase_request.py       Sun Mar 01 12:33:54 2020 +0100
@@ -9,8 +9,6 @@
 from trytond.pool import Pool, PoolMeta
 from trytond.tools import grouped_slice
 
-__all__ = ['PurchaseRequest', 'PurchaseConfiguration',
-    'PurchaseConfigurationSupplyPeriod']
 supply_period = fields.TimeDelta("Supply Period")
 
 
diff -r 320fda524e14 -r d9825b10abef setup.py
--- a/setup.py  Wed Dec 04 11:09:37 2019 +0100
+++ b/setup.py  Sun Mar 01 12:33:54 2020 +0100
@@ -78,8 +78,8 @@
     keywords='tryton stock supply',
     package_dir={'trytond.modules.stock_supply': '.'},
     packages=(
-        ['trytond.modules.stock_supply'] +
-        ['trytond.modules.stock_supply.%s' % p for p in find_packages()]
+        ['trytond.modules.stock_supply']
+        + ['trytond.modules.stock_supply.%s' % p for p in find_packages()]
         ),
     package_data={
         'trytond.modules.stock_supply': (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 320fda524e14 -r d9825b10abef shipment.py
--- a/shipment.py       Wed Dec 04 11:09:37 2019 +0100
+++ b/shipment.py       Sun Mar 01 12:33:54 2020 +0100
@@ -6,8 +6,6 @@
 from trytond.transaction import Transaction
 from trytond.pool import Pool
 
-__all__ = ['ShipmentInternal']
-
 
 class ShipmentInternal(ModelSQL, ModelView):
     __name__ = 'stock.shipment.internal'
diff -r 320fda524e14 -r d9825b10abef stock.py
--- a/stock.py  Wed Dec 04 11:09:37 2019 +0100
+++ b/stock.py  Sun Mar 01 12:33:54 2020 +0100
@@ -8,10 +8,8 @@
 
 from .exceptions import SupplyWarning
 
-__all__ = ['StockSupply', 'StockSupplyStart']
 
-
-class StockSupply(Wizard):
+class Supply(Wizard):
     "Supply Stock"
     __name__ = 'stock.supply'
     start = StateView(
@@ -109,6 +107,6 @@
         return self.next_action('purchase')
 
 
-class StockSupplyStart(ModelView):
+class SupplyStart(ModelView):
     "Supply Stock"
     __name__ = 'stock.supply.start'

Reply via email to