fix: address all warnings from pylint
This commit is contained in:
parent
25b5ca127d
commit
988ebe29d0
15 changed files with 101 additions and 43 deletions
4
.pylintrc
Normal file
4
.pylintrc
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
# -*- mode: conf; -*-
|
||||||
|
|
||||||
|
[MESSAGES CONTROL]
|
||||||
|
disable=fixme
|
|
@ -19,6 +19,9 @@ It provides the following:
|
||||||
|
|
||||||
.. _pyCOREPOS: https://pypi.org/project/pyCOREPOS/
|
.. _pyCOREPOS: https://pypi.org/project/pyCOREPOS/
|
||||||
|
|
||||||
|
.. image:: https://img.shields.io/badge/linting-pylint-yellowgreen
|
||||||
|
:target: https://github.com/pylint-dev/pylint
|
||||||
|
|
||||||
.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
|
.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
|
||||||
:target: https://github.com/psf/black
|
:target: https://github.com/psf/black
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,7 @@ dependencies = [
|
||||||
[project.optional-dependencies]
|
[project.optional-dependencies]
|
||||||
web = ["WuttaWeb"]
|
web = ["WuttaWeb"]
|
||||||
docs = ["Sphinx", "furo"]
|
docs = ["Sphinx", "furo"]
|
||||||
tests = ["pytest-cov", "tox"]
|
tests = ["pylint", "pytest", "pytest-cov", "tox"]
|
||||||
|
|
||||||
|
|
||||||
[project.entry-points."wutta.app.providers"]
|
[project.entry-points."wutta.app.providers"]
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
# -*- coding: utf-8; -*-
|
# -*- coding: utf-8; -*-
|
||||||
|
"""
|
||||||
|
Package Version
|
||||||
|
"""
|
||||||
|
|
||||||
from importlib.metadata import version
|
from importlib.metadata import version
|
||||||
|
|
||||||
|
|
|
@ -41,11 +41,11 @@ class WuttaCoreposAppProvider(AppProvider):
|
||||||
|
|
||||||
:rtype: :class:`~wutta_corepos.handler.CoreposHandler`
|
:rtype: :class:`~wutta_corepos.handler.CoreposHandler`
|
||||||
"""
|
"""
|
||||||
if not hasattr(self, "corepos_handler"):
|
if "corepos" not in self.app.handlers:
|
||||||
spec = self.config.get(
|
spec = self.config.get(
|
||||||
f"{self.appname}.corepos_handler",
|
f"{self.appname}.corepos_handler",
|
||||||
default="wutta_corepos.handler:CoreposHandler",
|
default="wutta_corepos.handler:CoreposHandler",
|
||||||
)
|
)
|
||||||
factory = self.app.load_object(spec)
|
factory = self.app.load_object(spec)
|
||||||
self.corepos_handler = factory(self.config, **kwargs)
|
self.app.handlers["corepos"] = factory(self.config, **kwargs)
|
||||||
return self.corepos_handler
|
return self.app.handlers["corepos"]
|
||||||
|
|
|
@ -106,53 +106,65 @@ class WuttaCoreposConfigExtension(WuttaConfigExtension):
|
||||||
|
|
||||||
key = "wutta_corepos"
|
key = "wutta_corepos"
|
||||||
|
|
||||||
def configure(self, config):
|
def configure(self, config): # pylint: disable=empty-docstring
|
||||||
""" """
|
""" """
|
||||||
|
|
||||||
# office_op
|
# office_op
|
||||||
from corepos.db.office_op import Session
|
from corepos.db.office_op import ( # pylint: disable=import-outside-toplevel
|
||||||
|
Session as OfficeOpSession,
|
||||||
|
)
|
||||||
|
|
||||||
engines = get_engines(config, "corepos.db.office_op")
|
engines = get_engines(config, "corepos.db.office_op")
|
||||||
config.core_office_op_engines = engines
|
config.core_office_op_engines = engines
|
||||||
config.core_office_op_engine = engines.get("default")
|
config.core_office_op_engine = engines.get("default")
|
||||||
Session.configure(bind=config.core_office_op_engine)
|
OfficeOpSession.configure(bind=config.core_office_op_engine)
|
||||||
|
|
||||||
# office_trans
|
# office_trans
|
||||||
from corepos.db.office_trans import Session
|
from corepos.db.office_trans import ( # pylint: disable=import-outside-toplevel
|
||||||
|
Session as OfficeTransSession,
|
||||||
|
)
|
||||||
|
|
||||||
engines = get_engines(config, "corepos.db.office_trans")
|
engines = get_engines(config, "corepos.db.office_trans")
|
||||||
config.core_office_trans_engines = engines
|
config.core_office_trans_engines = engines
|
||||||
config.core_office_trans_engine = engines.get("default")
|
config.core_office_trans_engine = engines.get("default")
|
||||||
Session.configure(bind=config.core_office_trans_engine)
|
OfficeTransSession.configure(bind=config.core_office_trans_engine)
|
||||||
|
|
||||||
# office_arch
|
# office_arch
|
||||||
from corepos.db.office_arch import Session
|
from corepos.db.office_arch import ( # pylint: disable=import-outside-toplevel
|
||||||
|
Session as OfficeArchSession,
|
||||||
|
)
|
||||||
|
|
||||||
engines = get_engines(config, "corepos.db.office_arch")
|
engines = get_engines(config, "corepos.db.office_arch")
|
||||||
config.core_office_arch_engines = engines
|
config.core_office_arch_engines = engines
|
||||||
config.core_office_arch_engine = engines.get("default")
|
config.core_office_arch_engine = engines.get("default")
|
||||||
Session.configure(bind=config.core_office_arch_engine)
|
OfficeArchSession.configure(bind=config.core_office_arch_engine)
|
||||||
|
|
||||||
# lane_op
|
# lane_op
|
||||||
from corepos.db.lane_op import Session
|
from corepos.db.lane_op import ( # pylint: disable=import-outside-toplevel
|
||||||
|
Session as LaneOpSession,
|
||||||
|
)
|
||||||
|
|
||||||
engines = get_engines(config, "corepos.db.lane_op")
|
engines = get_engines(config, "corepos.db.lane_op")
|
||||||
config.core_lane_op_engines = engines
|
config.core_lane_op_engines = engines
|
||||||
config.core_lane_op_engine = engines.get("default")
|
config.core_lane_op_engine = engines.get("default")
|
||||||
Session.configure(bind=config.core_lane_op_engine)
|
LaneOpSession.configure(bind=config.core_lane_op_engine)
|
||||||
|
|
||||||
# lane_trans
|
# lane_trans
|
||||||
from corepos.db.lane_trans import Session
|
from corepos.db.lane_trans import ( # pylint: disable=import-outside-toplevel
|
||||||
|
Session as LaneTransSession,
|
||||||
|
)
|
||||||
|
|
||||||
engines = get_engines(config, "corepos.db.lane_trans")
|
engines = get_engines(config, "corepos.db.lane_trans")
|
||||||
config.core_lane_trans_engines = engines
|
config.core_lane_trans_engines = engines
|
||||||
config.core_lane_trans_engine = engines.get("default")
|
config.core_lane_trans_engine = engines.get("default")
|
||||||
Session.configure(bind=config.core_lane_trans_engine)
|
LaneTransSession.configure(bind=config.core_lane_trans_engine)
|
||||||
|
|
||||||
# define some schema columns "late" unless not supported
|
# define some schema columns "late" unless not supported
|
||||||
if config.get_bool(
|
if config.get_bool(
|
||||||
"corepos.db.office_op.use_latest_columns", default=True, usedb=False
|
"corepos.db.office_op.use_latest_columns", default=True, usedb=False
|
||||||
):
|
):
|
||||||
from corepos.db.office_op.model import use_latest_columns
|
from corepos.db.office_op.model import ( # pylint: disable=import-outside-toplevel
|
||||||
|
use_latest_columns,
|
||||||
|
)
|
||||||
|
|
||||||
use_latest_columns()
|
use_latest_columns()
|
||||||
|
|
|
@ -30,7 +30,7 @@ from sqlalchemy import orm
|
||||||
from wuttjamaican.db import model
|
from wuttjamaican.db import model
|
||||||
|
|
||||||
|
|
||||||
class CoreUser(model.Base):
|
class CoreUser(model.Base): # pylint: disable=too-few-public-methods
|
||||||
"""
|
"""
|
||||||
CORE-POS extension for
|
CORE-POS extension for
|
||||||
:class:`~wuttjamaican:wuttjamaican.db.model.auth.User`.
|
:class:`~wuttjamaican:wuttjamaican.db.model.auth.User`.
|
||||||
|
|
|
@ -38,7 +38,9 @@ class CoreposHandler(GenericHandler):
|
||||||
Returns the :term:`data model` module for CORE Office 'op' DB,
|
Returns the :term:`data model` module for CORE Office 'op' DB,
|
||||||
i.e. :mod:`pycorepos:corepos.db.office_op.model`.
|
i.e. :mod:`pycorepos:corepos.db.office_op.model`.
|
||||||
"""
|
"""
|
||||||
from corepos.db.office_op import model
|
from corepos.db.office_op import ( # pylint: disable=import-outside-toplevel
|
||||||
|
model,
|
||||||
|
)
|
||||||
|
|
||||||
return model
|
return model
|
||||||
|
|
||||||
|
@ -47,7 +49,9 @@ class CoreposHandler(GenericHandler):
|
||||||
Returns the :term:`data model` module for CORE Office 'trans'
|
Returns the :term:`data model` module for CORE Office 'trans'
|
||||||
DB, i.e. :mod:`pycorepos:corepos.db.office_trans.model`.
|
DB, i.e. :mod:`pycorepos:corepos.db.office_trans.model`.
|
||||||
"""
|
"""
|
||||||
from corepos.db.office_trans import model
|
from corepos.db.office_trans import ( # pylint: disable=import-outside-toplevel
|
||||||
|
model,
|
||||||
|
)
|
||||||
|
|
||||||
return model
|
return model
|
||||||
|
|
||||||
|
@ -56,7 +60,9 @@ class CoreposHandler(GenericHandler):
|
||||||
Returns the :term:`data model` module for CORE Office 'arch'
|
Returns the :term:`data model` module for CORE Office 'arch'
|
||||||
DB, i.e. :mod:`pycorepos:corepos.db.office_arch.model`.
|
DB, i.e. :mod:`pycorepos:corepos.db.office_arch.model`.
|
||||||
"""
|
"""
|
||||||
from corepos.db.office_arch import model
|
from corepos.db.office_arch import ( # pylint: disable=import-outside-toplevel
|
||||||
|
model,
|
||||||
|
)
|
||||||
|
|
||||||
return model
|
return model
|
||||||
|
|
||||||
|
@ -65,7 +71,7 @@ class CoreposHandler(GenericHandler):
|
||||||
Returns the :term:`data model` module for CORE Lane 'op' DB,
|
Returns the :term:`data model` module for CORE Lane 'op' DB,
|
||||||
i.e. :mod:`pycorepos:corepos.db.lane_op.model`.
|
i.e. :mod:`pycorepos:corepos.db.lane_op.model`.
|
||||||
"""
|
"""
|
||||||
from corepos.db.lane_op import model
|
from corepos.db.lane_op import model # pylint: disable=import-outside-toplevel
|
||||||
|
|
||||||
return model
|
return model
|
||||||
|
|
||||||
|
@ -74,7 +80,9 @@ class CoreposHandler(GenericHandler):
|
||||||
Returns the :term:`data model` module for CORE Lane 'trans'
|
Returns the :term:`data model` module for CORE Lane 'trans'
|
||||||
DB, i.e. :mod:`pycorepos:corepos.db.lane_trans.model`.
|
DB, i.e. :mod:`pycorepos:corepos.db.lane_trans.model`.
|
||||||
"""
|
"""
|
||||||
from corepos.db.lane_trans import model
|
from corepos.db.lane_trans import ( # pylint: disable=import-outside-toplevel
|
||||||
|
model,
|
||||||
|
)
|
||||||
|
|
||||||
return model
|
return model
|
||||||
|
|
||||||
|
@ -85,7 +93,9 @@ class CoreposHandler(GenericHandler):
|
||||||
:returns: Instance of
|
:returns: Instance of
|
||||||
:class:`pycorepos:corepos.db.office_op.Session`.
|
:class:`pycorepos:corepos.db.office_op.Session`.
|
||||||
"""
|
"""
|
||||||
from corepos.db.office_op import Session
|
from corepos.db.office_op import ( # pylint: disable=import-outside-toplevel
|
||||||
|
Session,
|
||||||
|
)
|
||||||
|
|
||||||
if "bind" not in kwargs:
|
if "bind" not in kwargs:
|
||||||
kwargs["bind"] = self.config.core_office_op_engines[dbkey]
|
kwargs["bind"] = self.config.core_office_op_engines[dbkey]
|
||||||
|
@ -98,7 +108,9 @@ class CoreposHandler(GenericHandler):
|
||||||
:returns: Instance of
|
:returns: Instance of
|
||||||
:class:`pycorepos:corepos.db.office_trans.Session`.
|
:class:`pycorepos:corepos.db.office_trans.Session`.
|
||||||
"""
|
"""
|
||||||
from corepos.db.office_trans import Session
|
from corepos.db.office_trans import ( # pylint: disable=import-outside-toplevel
|
||||||
|
Session,
|
||||||
|
)
|
||||||
|
|
||||||
if "bind" not in kwargs:
|
if "bind" not in kwargs:
|
||||||
kwargs["bind"] = self.config.core_office_trans_engines[dbkey]
|
kwargs["bind"] = self.config.core_office_trans_engines[dbkey]
|
||||||
|
@ -111,7 +123,9 @@ class CoreposHandler(GenericHandler):
|
||||||
:returns: Instance of
|
:returns: Instance of
|
||||||
:class:`pycorepos:corepos.db.office_arch.Session`.
|
:class:`pycorepos:corepos.db.office_arch.Session`.
|
||||||
"""
|
"""
|
||||||
from corepos.db.office_arch import Session
|
from corepos.db.office_arch import ( # pylint: disable=import-outside-toplevel
|
||||||
|
Session,
|
||||||
|
)
|
||||||
|
|
||||||
if "bind" not in kwargs:
|
if "bind" not in kwargs:
|
||||||
kwargs["bind"] = self.config.core_office_arch_engines[dbkey]
|
kwargs["bind"] = self.config.core_office_arch_engines[dbkey]
|
||||||
|
@ -124,7 +138,9 @@ class CoreposHandler(GenericHandler):
|
||||||
:returns: Instance of
|
:returns: Instance of
|
||||||
:class:`pycorepos:corepos.db.lane_op.Session`.
|
:class:`pycorepos:corepos.db.lane_op.Session`.
|
||||||
"""
|
"""
|
||||||
from corepos.db.lane_op import Session
|
from corepos.db.lane_op import ( # pylint: disable=import-outside-toplevel
|
||||||
|
Session,
|
||||||
|
)
|
||||||
|
|
||||||
if "bind" not in kwargs:
|
if "bind" not in kwargs:
|
||||||
kwargs["bind"] = self.config.core_lane_op_engines[dbkey]
|
kwargs["bind"] = self.config.core_lane_op_engines[dbkey]
|
||||||
|
@ -137,7 +153,9 @@ class CoreposHandler(GenericHandler):
|
||||||
:returns: Instance of
|
:returns: Instance of
|
||||||
:class:`pycorepos:corepos.db.lane_trans.Session`.
|
:class:`pycorepos:corepos.db.lane_trans.Session`.
|
||||||
"""
|
"""
|
||||||
from corepos.db.lane_trans import Session
|
from corepos.db.lane_trans import ( # pylint: disable=import-outside-toplevel
|
||||||
|
Session,
|
||||||
|
)
|
||||||
|
|
||||||
if "bind" not in kwargs:
|
if "bind" not in kwargs:
|
||||||
kwargs["bind"] = self.config.core_lane_trans_engines[dbkey]
|
kwargs["bind"] = self.config.core_lane_trans_engines[dbkey]
|
||||||
|
@ -157,6 +175,7 @@ class CoreposHandler(GenericHandler):
|
||||||
url = self.config.get("corepos.office.url", require=require)
|
url = self.config.get("corepos.office.url", require=require)
|
||||||
if url:
|
if url:
|
||||||
return url.rstrip("/")
|
return url.rstrip("/")
|
||||||
|
return None
|
||||||
|
|
||||||
def get_office_department_url(self, dept_id, office_url=None, require=False):
|
def get_office_department_url(self, dept_id, office_url=None, require=False):
|
||||||
"""
|
"""
|
||||||
|
@ -175,6 +194,7 @@ class CoreposHandler(GenericHandler):
|
||||||
office_url = self.get_office_url(require=require)
|
office_url = self.get_office_url(require=require)
|
||||||
if office_url:
|
if office_url:
|
||||||
return f"{office_url}/item/departments/DepartmentEditor.php?did={dept_id}"
|
return f"{office_url}/item/departments/DepartmentEditor.php?did={dept_id}"
|
||||||
|
return None
|
||||||
|
|
||||||
def get_office_employee_url(self, employee_id, office_url=None, require=False):
|
def get_office_employee_url(self, employee_id, office_url=None, require=False):
|
||||||
"""
|
"""
|
||||||
|
@ -193,6 +213,7 @@ class CoreposHandler(GenericHandler):
|
||||||
office_url = self.get_office_url(require=require)
|
office_url = self.get_office_url(require=require)
|
||||||
if office_url:
|
if office_url:
|
||||||
return f"{office_url}/admin/Cashiers/CashierEditor.php?emp_no={employee_id}"
|
return f"{office_url}/admin/Cashiers/CashierEditor.php?emp_no={employee_id}"
|
||||||
|
return None
|
||||||
|
|
||||||
def get_office_likecode_url(self, likecode_id, office_url=None, require=False):
|
def get_office_likecode_url(self, likecode_id, office_url=None, require=False):
|
||||||
"""
|
"""
|
||||||
|
@ -211,6 +232,7 @@ class CoreposHandler(GenericHandler):
|
||||||
office_url = self.get_office_url(require=require)
|
office_url = self.get_office_url(require=require)
|
||||||
if office_url:
|
if office_url:
|
||||||
return f"{office_url}/item/likecodes/LikeCodeEditor.php?start={likecode_id}"
|
return f"{office_url}/item/likecodes/LikeCodeEditor.php?start={likecode_id}"
|
||||||
|
return None
|
||||||
|
|
||||||
def get_office_product_url(self, upc, office_url=None, require=False):
|
def get_office_product_url(self, upc, office_url=None, require=False):
|
||||||
"""
|
"""
|
||||||
|
@ -229,6 +251,7 @@ class CoreposHandler(GenericHandler):
|
||||||
office_url = self.get_office_url(require=require)
|
office_url = self.get_office_url(require=require)
|
||||||
if office_url:
|
if office_url:
|
||||||
return f"{office_url}/item/ItemEditorPage.php?searchupc={upc}"
|
return f"{office_url}/item/ItemEditorPage.php?searchupc={upc}"
|
||||||
|
return None
|
||||||
|
|
||||||
def get_office_vendor_url(self, vend_id, office_url=None, require=False):
|
def get_office_vendor_url(self, vend_id, office_url=None, require=False):
|
||||||
"""
|
"""
|
||||||
|
@ -247,3 +270,4 @@ class CoreposHandler(GenericHandler):
|
||||||
office_url = self.get_office_url(require=require)
|
office_url = self.get_office_url(require=require)
|
||||||
if office_url:
|
if office_url:
|
||||||
return f"{office_url}/item/vendors/VendorIndexPage.php?vid={vend_id}"
|
return f"{office_url}/item/vendors/VendorIndexPage.php?vid={vend_id}"
|
||||||
|
return None
|
||||||
|
|
|
@ -25,5 +25,5 @@ Wutta-COREPOS -- wuttaweb features
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
def includeme(config):
|
def includeme(config): # pylint: disable=missing-function-docstring
|
||||||
config.include("wutta_corepos.web.views")
|
config.include("wutta_corepos.web.views")
|
||||||
|
|
|
@ -25,5 +25,5 @@ Wutta-COREPOS -- wuttaweb views
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
def includeme(config):
|
def includeme(config): # pylint: disable=missing-function-docstring
|
||||||
config.include("wutta_corepos.web.views.corepos")
|
config.include("wutta_corepos.web.views.corepos")
|
||||||
|
|
|
@ -27,6 +27,6 @@ Views for CORE-POS
|
||||||
from .master import CoreOpMasterView
|
from .master import CoreOpMasterView
|
||||||
|
|
||||||
|
|
||||||
def includeme(config):
|
def includeme(config): # pylint: disable=missing-function-docstring
|
||||||
config.include("wutta_corepos.web.views.corepos.members")
|
config.include("wutta_corepos.web.views.corepos.members")
|
||||||
config.include("wutta_corepos.web.views.corepos.products")
|
config.include("wutta_corepos.web.views.corepos.products")
|
||||||
|
|
|
@ -29,7 +29,7 @@ from wuttaweb.views import MasterView
|
||||||
from wutta_corepos.web.db import CoreOpSession
|
from wutta_corepos.web.db import CoreOpSession
|
||||||
|
|
||||||
|
|
||||||
class CoreOpMasterView(MasterView):
|
class CoreOpMasterView(MasterView): # pylint: disable=abstract-method
|
||||||
"""
|
"""
|
||||||
Base class for master views which use the CORE Office 'op' DB.
|
Base class for master views which use the CORE Office 'op' DB.
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -32,7 +32,7 @@ from corepos.db.office_op.model import MemberInfo
|
||||||
from wutta_corepos.web.views.corepos import CoreOpMasterView
|
from wutta_corepos.web.views.corepos import CoreOpMasterView
|
||||||
|
|
||||||
|
|
||||||
class MemberView(CoreOpMasterView):
|
class MemberView(CoreOpMasterView): # pylint: disable=abstract-method
|
||||||
"""
|
"""
|
||||||
Master view for
|
Master view for
|
||||||
:class:`~pycorepos:corepos.db.office_op.model.MemberInfo`; route
|
:class:`~pycorepos:corepos.db.office_op.model.MemberInfo`; route
|
||||||
|
@ -74,7 +74,7 @@ class MemberView(CoreOpMasterView):
|
||||||
|
|
||||||
sort_defaults = "card_number"
|
sort_defaults = "card_number"
|
||||||
|
|
||||||
def get_query(self, session=None):
|
def get_query(self, session=None): # pylint: disable=empty-docstring
|
||||||
""" """
|
""" """
|
||||||
query = super().get_query(session=session)
|
query = super().get_query(session=session)
|
||||||
|
|
||||||
|
@ -89,8 +89,9 @@ class MemberView(CoreOpMasterView):
|
||||||
|
|
||||||
return query
|
return query
|
||||||
|
|
||||||
def configure_grid(self, g):
|
def configure_grid(self, grid): # pylint: disable=empty-docstring
|
||||||
""" """
|
""" """
|
||||||
|
g = grid
|
||||||
super().configure_grid(g)
|
super().configure_grid(g)
|
||||||
op_model = self.corepos_handler.get_model_office_op()
|
op_model = self.corepos_handler.get_model_office_op()
|
||||||
|
|
||||||
|
@ -108,18 +109,22 @@ class MemberView(CoreOpMasterView):
|
||||||
g.set_link("first_name")
|
g.set_link("first_name")
|
||||||
g.set_link("last_name")
|
g.set_link("last_name")
|
||||||
|
|
||||||
def render_customer_attr(self, member, key, value):
|
def render_customer_attr( # pylint: disable=unused-argument,empty-docstring
|
||||||
|
self, member, key, value
|
||||||
|
):
|
||||||
""" """
|
""" """
|
||||||
customer = member.customers[0]
|
customer = member.customers[0]
|
||||||
return getattr(customer, key)
|
return getattr(customer, key)
|
||||||
|
|
||||||
|
|
||||||
def defaults(config, **kwargs):
|
def defaults(config, **kwargs): # pylint: disable=missing-function-docstring
|
||||||
base = globals()
|
base = globals()
|
||||||
|
|
||||||
MemberView = kwargs.get("MemberView", base["MemberView"])
|
MemberView = kwargs.get( # pylint: disable=invalid-name,redefined-outer-name
|
||||||
|
"MemberView", base["MemberView"]
|
||||||
|
)
|
||||||
MemberView.defaults(config)
|
MemberView.defaults(config)
|
||||||
|
|
||||||
|
|
||||||
def includeme(config):
|
def includeme(config): # pylint: disable=missing-function-docstring
|
||||||
defaults(config)
|
defaults(config)
|
||||||
|
|
|
@ -29,7 +29,7 @@ from corepos.db.office_op.model import Product
|
||||||
from wutta_corepos.web.views.corepos import CoreOpMasterView
|
from wutta_corepos.web.views.corepos import CoreOpMasterView
|
||||||
|
|
||||||
|
|
||||||
class ProductView(CoreOpMasterView):
|
class ProductView(CoreOpMasterView): # pylint: disable=abstract-method
|
||||||
"""
|
"""
|
||||||
Master view for
|
Master view for
|
||||||
:class:`~pycorepos:corepos.db.office_op.model.Product`; route
|
:class:`~pycorepos:corepos.db.office_op.model.Product`; route
|
||||||
|
@ -73,8 +73,9 @@ class ProductView(CoreOpMasterView):
|
||||||
|
|
||||||
sort_defaults = "upc"
|
sort_defaults = "upc"
|
||||||
|
|
||||||
def configure_grid(self, g):
|
def configure_grid(self, grid): # pylint: disable=empty-docstring
|
||||||
""" """
|
""" """
|
||||||
|
g = grid
|
||||||
super().configure_grid(g)
|
super().configure_grid(g)
|
||||||
|
|
||||||
# normal_price
|
# normal_price
|
||||||
|
@ -87,12 +88,14 @@ class ProductView(CoreOpMasterView):
|
||||||
g.set_link("size")
|
g.set_link("size")
|
||||||
|
|
||||||
|
|
||||||
def defaults(config, **kwargs):
|
def defaults(config, **kwargs): # pylint: disable=missing-function-docstring
|
||||||
base = globals()
|
base = globals()
|
||||||
|
|
||||||
ProductView = kwargs.get("ProductView", base["ProductView"])
|
ProductView = kwargs.get( # pylint: disable=invalid-name,redefined-outer-name
|
||||||
|
"ProductView", base["ProductView"]
|
||||||
|
)
|
||||||
ProductView.defaults(config)
|
ProductView.defaults(config)
|
||||||
|
|
||||||
|
|
||||||
def includeme(config):
|
def includeme(config): # pylint: disable=missing-function-docstring
|
||||||
defaults(config)
|
defaults(config)
|
||||||
|
|
4
tox.ini
4
tox.ini
|
@ -6,6 +6,10 @@ envlist = py38, py39, py310, py311
|
||||||
extras = web,tests
|
extras = web,tests
|
||||||
commands = pytest {posargs}
|
commands = pytest {posargs}
|
||||||
|
|
||||||
|
[testenv:pylint]
|
||||||
|
basepython = python3.11
|
||||||
|
commands = pylint wutta_corepos
|
||||||
|
|
||||||
[testenv:coverage]
|
[testenv:coverage]
|
||||||
basepython = python3.11
|
basepython = python3.11
|
||||||
commands = pytest --cov=wutta_corepos --cov-report=html --cov-fail-under=100
|
commands = pytest --cov=wutta_corepos --cov-report=html --cov-fail-under=100
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue