2222
2323"""
2424
25- from micropython import const
2625from adafruit_display_shapes .rect import Rect
2726from adafruit_display_shapes .roundrect import RoundRect
27+ from micropython import const
28+
2829from adafruit_button .button_base import ButtonBase , _check_color
2930
3031try :
31- from typing import Optional , Union , Tuple
32- from fontio import FontProtocol
32+ from typing import Optional , Tuple , Union
33+
3334 from displayio import Group
35+ from fontio import FontProtocol
3436except ImportError :
3537 pass
3638
3941
4042
4143class Button (ButtonBase ):
42- # pylint: disable=too-many-instance-attributes, too-many-locals
4344 """Helper class for creating UI buttons for ``displayio``. Provides the following
4445 buttons:
4546 RECT: A rectangular button. SHAWDOWRECT adds a drop shadow.
@@ -100,9 +101,7 @@ def _create_body(self) -> None:
100101 outline = self ._outline_color ,
101102 )
102103 elif self .style == Button .SHADOWRECT :
103- self .shadow = Rect (
104- 2 , 2 , self .width - 2 , self .height - 2 , fill = self .outline_color
105- )
104+ self .shadow = Rect (2 , 2 , self .width - 2 , self .height - 2 , fill = self .outline_color )
106105 self .body = Rect (
107106 0 ,
108107 0 ,
@@ -137,7 +136,7 @@ def _create_body(self) -> None:
137136 SHADOWRECT = const (2 )
138137 SHADOWROUNDRECT = const (3 )
139138
140- def __init__ (
139+ def __init__ ( # noqa: PLR0913 Too many arguments
141140 self ,
142141 * ,
143142 x : int ,
@@ -154,7 +153,7 @@ def __init__(
154153 selected_fill : Optional [Union [int , Tuple [int , int , int ]]] = None ,
155154 selected_outline : Optional [Union [int , Tuple [int , int , int ]]] = None ,
156155 selected_label : Optional [Union [int , Tuple [int , int , int ]]] = None ,
157- label_scale : Optional [int ] = 1
156+ label_scale : Optional [int ] = 1 ,
158157 ):
159158 super ().__init__ (
160159 x = x ,
0 commit comments