fix: fix 'unused-argument' for pylint
This commit is contained in:
		
							parent
							
								
									4194d20988
								
							
						
					
					
						commit
						2e248adb82
					
				
					 8 changed files with 34 additions and 29 deletions
				
			
		| 
						 | 
					@ -30,4 +30,3 @@ disable=fixme,
 | 
				
			||||||
        too-many-positional-arguments,
 | 
					        too-many-positional-arguments,
 | 
				
			||||||
        too-many-public-methods,
 | 
					        too-many-public-methods,
 | 
				
			||||||
        unnecessary-lambda-assignment,
 | 
					        unnecessary-lambda-assignment,
 | 
				
			||||||
        unused-argument,
 | 
					 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -2,7 +2,7 @@
 | 
				
			||||||
################################################################################
 | 
					################################################################################
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
#  Sideshow -- Case/Special Order Tracker
 | 
					#  Sideshow -- Case/Special Order Tracker
 | 
				
			||||||
#  Copyright © 2024 Lance Edgar
 | 
					#  Copyright © 2024-2025 Lance Edgar
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
#  This file is part of Sideshow.
 | 
					#  This file is part of Sideshow.
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
| 
						 | 
					@ -35,7 +35,7 @@ class SideshowAppProvider(base.AppProvider):
 | 
				
			||||||
    handler`.
 | 
					    handler`.
 | 
				
			||||||
    """
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def get_order_handler(self, **kwargs):
 | 
					    def get_order_handler(self):
 | 
				
			||||||
        """
 | 
					        """
 | 
				
			||||||
        Get the configured :term:`order handler` for the app.
 | 
					        Get the configured :term:`order handler` for the app.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -137,7 +137,9 @@ class NewOrderBatchHandler(BatchHandler):
 | 
				
			||||||
        """
 | 
					        """
 | 
				
			||||||
        raise NotImplementedError
 | 
					        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
 | 
					        Return autocomplete search results for
 | 
				
			||||||
        :class:`~sideshow.db.model.customers.LocalCustomer` records.
 | 
					        :class:`~sideshow.db.model.customers.LocalCustomer` records.
 | 
				
			||||||
| 
						 | 
					@ -343,7 +345,9 @@ class NewOrderBatchHandler(BatchHandler):
 | 
				
			||||||
        """
 | 
					        """
 | 
				
			||||||
        raise NotImplementedError
 | 
					        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
 | 
					        Return autocomplete search results for
 | 
				
			||||||
        :class:`~sideshow.db.model.products.LocalProduct` records.
 | 
					        :class:`~sideshow.db.model.products.LocalProduct` records.
 | 
				
			||||||
| 
						 | 
					@ -468,7 +472,9 @@ class NewOrderBatchHandler(BatchHandler):
 | 
				
			||||||
        """
 | 
					        """
 | 
				
			||||||
        raise NotImplementedError
 | 
					        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
 | 
					        Returns basic info for a :term:`local product` as pertains to
 | 
				
			||||||
        ordering.
 | 
					        ordering.
 | 
				
			||||||
| 
						 | 
					@ -1187,7 +1193,7 @@ class NewOrderBatchHandler(BatchHandler):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        session.flush()
 | 
					        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.
 | 
					        Create a new :term:`order` from the batch data.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1252,7 +1258,7 @@ class NewOrderBatchHandler(BatchHandler):
 | 
				
			||||||
        session.add(order)
 | 
					        session.add(order)
 | 
				
			||||||
        session.flush()
 | 
					        session.flush()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        def convert(row, i):
 | 
					        def convert(row, i):  # pylint: disable=unused-argument
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            # make order item
 | 
					            # make order item
 | 
				
			||||||
            kw = dict([(field, getattr(row, field)) for field in row_fields])
 | 
					            kw = dict([(field, getattr(row, field)) for field in row_fields])
 | 
				
			||||||
| 
						 | 
					@ -1268,7 +1274,7 @@ class NewOrderBatchHandler(BatchHandler):
 | 
				
			||||||
        session.flush()
 | 
					        session.flush()
 | 
				
			||||||
        return order
 | 
					        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.
 | 
					        Set the initial status and attach event(s) for the given item.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -27,7 +27,7 @@ Sideshow web app
 | 
				
			||||||
from wuttaweb import app as base
 | 
					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).
 | 
					    Make and return the WSGI app (Paste entry point).
 | 
				
			||||||
    """
 | 
					    """
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -2,7 +2,7 @@
 | 
				
			||||||
################################################################################
 | 
					################################################################################
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
#  Sideshow -- Case/Special Order Tracker
 | 
					#  Sideshow -- Case/Special Order Tracker
 | 
				
			||||||
#  Copyright © 2024 Lance Edgar
 | 
					#  Copyright © 2024-2025 Lance Edgar
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
#  This file is part of Sideshow.
 | 
					#  This file is part of Sideshow.
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
| 
						 | 
					@ -32,7 +32,7 @@ class SideshowMenuHandler(base.MenuHandler):
 | 
				
			||||||
    Sideshow menu handler
 | 
					    Sideshow menu handler
 | 
				
			||||||
    """
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def make_menus(self, request, **kwargs):
 | 
					    def make_menus(self, request):
 | 
				
			||||||
        """ """
 | 
					        """ """
 | 
				
			||||||
        return [
 | 
					        return [
 | 
				
			||||||
            self.make_orders_menu(request),
 | 
					            self.make_orders_menu(request),
 | 
				
			||||||
| 
						 | 
					@ -43,7 +43,7 @@ class SideshowMenuHandler(base.MenuHandler):
 | 
				
			||||||
            self.make_admin_menu(request),
 | 
					            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.
 | 
					        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.
 | 
					        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.
 | 
					        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.
 | 
					        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.
 | 
					        Generate the "Other" menu.
 | 
				
			||||||
        """
 | 
					        """
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -590,7 +590,7 @@ class OrderView(MasterView):
 | 
				
			||||||
        self.batch_handler.set_customer(batch, customer_id)
 | 
					        self.batch_handler.set_customer(batch, customer_id)
 | 
				
			||||||
        return self.get_context_customer(batch)
 | 
					        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.
 | 
					        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)
 | 
					        self.batch_handler.set_customer(batch, data, user=self.request.user)
 | 
				
			||||||
        return self.get_context_customer(batch)
 | 
					        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.
 | 
					        Fetch data for a specific product.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -698,7 +698,7 @@ class OrderView(MasterView):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        return data
 | 
					        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.
 | 
					        Fetch past products for convenient re-ordering.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -793,7 +793,7 @@ class OrderView(MasterView):
 | 
				
			||||||
        self.batch_handler.do_remove_row(row)
 | 
					        self.batch_handler.do_remove_row(row)
 | 
				
			||||||
        return {"batch": self.normalize_batch(batch)}
 | 
					        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
 | 
					        This submits the user's current new order batch, hence
 | 
				
			||||||
        executing the batch and creating the true order.
 | 
					        executing the batch and creating the true order.
 | 
				
			||||||
| 
						 | 
					@ -1041,13 +1041,13 @@ class OrderView(MasterView):
 | 
				
			||||||
        # TODO: upstream should set this automatically
 | 
					        # TODO: upstream should set this automatically
 | 
				
			||||||
        g.row_class = self.row_grid_row_class
 | 
					        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)
 | 
					        variant = self.order_handler.item_status_to_variant(item.status_code)
 | 
				
			||||||
        if variant:
 | 
					        if variant:
 | 
				
			||||||
            return f"has-background-{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
 | 
					        enum = self.app.enum
 | 
				
			||||||
        return enum.ORDER_ITEM_STATUS[value]
 | 
					        return enum.ORDER_ITEM_STATUS[value]
 | 
				
			||||||
| 
						 | 
					@ -1381,17 +1381,17 @@ class OrderItemView(MasterView):
 | 
				
			||||||
        # status_code
 | 
					        # status_code
 | 
				
			||||||
        g.set_renderer("status_code", self.render_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
 | 
					        order = item.order
 | 
				
			||||||
        return getattr(order, key)
 | 
					        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
 | 
					        enum = self.app.enum
 | 
				
			||||||
        return enum.ORDER_ITEM_STATUS[value]
 | 
					        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)
 | 
					        variant = self.order_handler.item_status_to_variant(item.status_code)
 | 
				
			||||||
        if variant:
 | 
					        if variant:
 | 
				
			||||||
| 
						 | 
					@ -1495,7 +1495,7 @@ class OrderItemView(MasterView):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        return context
 | 
					        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
 | 
					        enum = self.app.enum
 | 
				
			||||||
        if event.type_code == enum.ORDER_ITEM_EVENT_NOTE_ADDED:
 | 
					        if event.type_code == enum.ORDER_ITEM_EVENT_NOTE_ADDED:
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -312,7 +312,7 @@ class PendingProductView(MasterView):
 | 
				
			||||||
        g.set_link("description")
 | 
					        g.set_link("description")
 | 
				
			||||||
        g.set_link("size")
 | 
					        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
 | 
					        enum = self.app.enum
 | 
				
			||||||
        if product.status == enum.PendingProductStatus.IGNORED:
 | 
					        if product.status == enum.PendingProductStatus.IGNORED:
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -64,7 +64,7 @@ class StoreView(MasterView):
 | 
				
			||||||
        g.set_link("store_id")
 | 
					        g.set_link("store_id")
 | 
				
			||||||
        g.set_link("name")
 | 
					        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:
 | 
					        if store.archived:
 | 
				
			||||||
            return "has-background-warning"
 | 
					            return "has-background-warning"
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue