From 2e248adb827acd335a75f9b3d1d3538b3f1643f1 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Mon, 1 Sep 2025 14:07:38 -0500 Subject: [PATCH] fix: fix 'unused-argument' for pylint --- .pylintrc | 1 - src/sideshow/app.py | 4 ++-- src/sideshow/batch/neworder.py | 18 ++++++++++++------ src/sideshow/web/app.py | 2 +- src/sideshow/web/menus.py | 14 +++++++------- src/sideshow/web/views/orders.py | 20 ++++++++++---------- src/sideshow/web/views/products.py | 2 +- src/sideshow/web/views/stores.py | 2 +- 8 files changed, 34 insertions(+), 29 deletions(-) diff --git a/.pylintrc b/.pylintrc index 5476de1..79bcb87 100644 --- a/.pylintrc +++ b/.pylintrc @@ -30,4 +30,3 @@ disable=fixme, too-many-positional-arguments, too-many-public-methods, unnecessary-lambda-assignment, - unused-argument, diff --git a/src/sideshow/app.py b/src/sideshow/app.py index ec2f85a..bbe24a6 100644 --- a/src/sideshow/app.py +++ b/src/sideshow/app.py @@ -2,7 +2,7 @@ ################################################################################ # # Sideshow -- Case/Special Order Tracker -# Copyright © 2024 Lance Edgar +# Copyright © 2024-2025 Lance Edgar # # This file is part of Sideshow. # @@ -35,7 +35,7 @@ class SideshowAppProvider(base.AppProvider): handler`. """ - def get_order_handler(self, **kwargs): + def get_order_handler(self): """ Get the configured :term:`order handler` for the app. diff --git a/src/sideshow/batch/neworder.py b/src/sideshow/batch/neworder.py index 11dac0b..292dc8e 100644 --- a/src/sideshow/batch/neworder.py +++ b/src/sideshow/batch/neworder.py @@ -137,7 +137,9 @@ class NewOrderBatchHandler(BatchHandler): """ raise NotImplementedError - def autocomplete_customers_local(self, session, term, user=None): + def autocomplete_customers_local( # pylint: disable=unused-argument + self, session, term, user=None + ): """ Return autocomplete search results for :class:`~sideshow.db.model.customers.LocalCustomer` records. @@ -343,7 +345,9 @@ class NewOrderBatchHandler(BatchHandler): """ raise NotImplementedError - def autocomplete_products_local(self, session, term, user=None): + def autocomplete_products_local( # pylint: disable=unused-argument + self, session, term, user=None + ): """ Return autocomplete search results for :class:`~sideshow.db.model.products.LocalProduct` records. @@ -468,7 +472,9 @@ class NewOrderBatchHandler(BatchHandler): """ raise NotImplementedError - def get_product_info_local(self, session, uuid, user=None): + def get_product_info_local( # pylint: disable=unused-argument + self, session, uuid, user=None + ): """ Returns basic info for a :term:`local product` as pertains to ordering. @@ -1187,7 +1193,7 @@ class NewOrderBatchHandler(BatchHandler): session.flush() - def make_new_order(self, batch, rows, user=None, progress=None, **kwargs): + def make_new_order(self, batch, rows, user=None, progress=None): """ Create a new :term:`order` from the batch data. @@ -1252,7 +1258,7 @@ class NewOrderBatchHandler(BatchHandler): session.add(order) session.flush() - def convert(row, i): + def convert(row, i): # pylint: disable=unused-argument # make order item kw = dict([(field, getattr(row, field)) for field in row_fields]) @@ -1268,7 +1274,7 @@ class NewOrderBatchHandler(BatchHandler): session.flush() return order - def set_initial_item_status(self, item, user, **kwargs): + def set_initial_item_status(self, item, user): """ Set the initial status and attach event(s) for the given item. diff --git a/src/sideshow/web/app.py b/src/sideshow/web/app.py index 1b1e448..11e29db 100644 --- a/src/sideshow/web/app.py +++ b/src/sideshow/web/app.py @@ -27,7 +27,7 @@ Sideshow web app from wuttaweb import app as base -def main(global_config, **settings): +def main(global_config, **settings): # pylint: disable=unused-argument """ Make and return the WSGI app (Paste entry point). """ diff --git a/src/sideshow/web/menus.py b/src/sideshow/web/menus.py index 14fb027..0ef3d70 100644 --- a/src/sideshow/web/menus.py +++ b/src/sideshow/web/menus.py @@ -2,7 +2,7 @@ ################################################################################ # # Sideshow -- Case/Special Order Tracker -# Copyright © 2024 Lance Edgar +# Copyright © 2024-2025 Lance Edgar # # This file is part of Sideshow. # @@ -32,7 +32,7 @@ class SideshowMenuHandler(base.MenuHandler): Sideshow menu handler """ - def make_menus(self, request, **kwargs): + def make_menus(self, request): """ """ return [ self.make_orders_menu(request), @@ -43,7 +43,7 @@ class SideshowMenuHandler(base.MenuHandler): self.make_admin_menu(request), ] - def make_orders_menu(self, request, **kwargs): + def make_orders_menu(self, request): # pylint: disable=unused-argument """ Generate the Orders menu. """ @@ -91,7 +91,7 @@ class SideshowMenuHandler(base.MenuHandler): ], } - def make_customers_menu(self, request, **kwargs): + def make_customers_menu(self, request): # pylint: disable=unused-argument """ Generate the Customers menu. """ @@ -112,7 +112,7 @@ class SideshowMenuHandler(base.MenuHandler): ], } - def make_products_menu(self, request, **kwargs): + def make_products_menu(self, request): # pylint: disable=unused-argument """ Generate the Products menu. """ @@ -133,7 +133,7 @@ class SideshowMenuHandler(base.MenuHandler): ], } - def make_batch_menu(self, request, **kwargs): + def make_batch_menu(self, request): # pylint: disable=unused-argument """ Generate the Batch menu. """ @@ -149,7 +149,7 @@ class SideshowMenuHandler(base.MenuHandler): ], } - def make_other_menu(self, request, **kwargs): + def make_other_menu(self, request): # pylint: disable=unused-argument """ Generate the "Other" menu. """ diff --git a/src/sideshow/web/views/orders.py b/src/sideshow/web/views/orders.py index 5dc72c4..2f64e77 100644 --- a/src/sideshow/web/views/orders.py +++ b/src/sideshow/web/views/orders.py @@ -590,7 +590,7 @@ class OrderView(MasterView): self.batch_handler.set_customer(batch, customer_id) return self.get_context_customer(batch) - def unassign_customer(self, batch, data): + def unassign_customer(self, batch, data): # pylint: disable=unused-argument """ Clear the customer info for a batch. @@ -624,7 +624,7 @@ class OrderView(MasterView): self.batch_handler.set_customer(batch, data, user=self.request.user) return self.get_context_customer(batch) - def get_product_info(self, batch, data): + def get_product_info(self, batch, data): # pylint: disable=unused-argument """ Fetch data for a specific product. @@ -698,7 +698,7 @@ class OrderView(MasterView): return data - def get_past_products(self, batch, data): + def get_past_products(self, batch, data): # pylint: disable=unused-argument """ Fetch past products for convenient re-ordering. @@ -793,7 +793,7 @@ class OrderView(MasterView): self.batch_handler.do_remove_row(row) return {"batch": self.normalize_batch(batch)} - def submit_order(self, batch, data): + def submit_order(self, batch, data): # pylint: disable=unused-argument """ This submits the user's current new order batch, hence executing the batch and creating the true order. @@ -1041,13 +1041,13 @@ class OrderView(MasterView): # TODO: upstream should set this automatically g.row_class = self.row_grid_row_class - def row_grid_row_class(self, item, data, i): + def row_grid_row_class(self, item, data, i): # pylint: disable=unused-argument """ """ variant = self.order_handler.item_status_to_variant(item.status_code) if variant: return f"has-background-{variant}" - def render_status_code(self, item, key, value): + def render_status_code(self, item, key, value): # pylint: disable=unused-argument """ """ enum = self.app.enum return enum.ORDER_ITEM_STATUS[value] @@ -1381,17 +1381,17 @@ class OrderItemView(MasterView): # status_code g.set_renderer("status_code", self.render_status_code) - def render_order_attr(self, item, key, value): + def render_order_attr(self, item, key, value): # pylint: disable=unused-argument """ """ order = item.order return getattr(order, key) - def render_status_code(self, item, key, value): + def render_status_code(self, item, key, value): # pylint: disable=unused-argument """ """ enum = self.app.enum return enum.ORDER_ITEM_STATUS[value] - def grid_row_class(self, item, data, i): + def grid_row_class(self, item, data, i): # pylint: disable=unused-argument """ """ variant = self.order_handler.item_status_to_variant(item.status_code) if variant: @@ -1495,7 +1495,7 @@ class OrderItemView(MasterView): return context - def render_event_note(self, event, key, value): + def render_event_note(self, event, key, value): # pylint: disable=unused-argument """ """ enum = self.app.enum if event.type_code == enum.ORDER_ITEM_EVENT_NOTE_ADDED: diff --git a/src/sideshow/web/views/products.py b/src/sideshow/web/views/products.py index ef7fc2d..1d1ee76 100644 --- a/src/sideshow/web/views/products.py +++ b/src/sideshow/web/views/products.py @@ -312,7 +312,7 @@ class PendingProductView(MasterView): g.set_link("description") g.set_link("size") - def grid_row_class(self, product, data, i): + def grid_row_class(self, product, data, i): # pylint: disable=unused-argument """ """ enum = self.app.enum if product.status == enum.PendingProductStatus.IGNORED: diff --git a/src/sideshow/web/views/stores.py b/src/sideshow/web/views/stores.py index 13282c9..4c3c1df 100644 --- a/src/sideshow/web/views/stores.py +++ b/src/sideshow/web/views/stores.py @@ -64,7 +64,7 @@ class StoreView(MasterView): g.set_link("store_id") g.set_link("name") - def grid_row_class(self, store, data, i): + def grid_row_class(self, store, data, i): # pylint: disable=unused-argument """ """ if store.archived: return "has-background-warning"