Skip to content

Commit 5efae78

Browse files
committed
moar pylint
1 parent 208b435 commit 5efae78

File tree

11 files changed

+46
-16
lines changed

11 files changed

+46
-16
lines changed

Fruit_Jam/Larsio_Paint_Music/code.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
or Metro RP2350 with EYESPI DVI breakout and TLV320DAC3100 breakout on STEMMA_I2C,
88
pin D7 reset, 9/10/11 = BCLC/WSEL/DIN
99
"""
10-
# pylint: disable=invalid-name,too-few-public-methods,broad-exception-caught,redefined-outer-name
10+
# pylint: disable=invalid-name,too-few-public-methods,broad-except,redefined-outer-name
1111

1212
# Main application file for Larsio Paint Music
1313

@@ -101,7 +101,7 @@ def run(self):
101101
try:
102102
app = MusicStaffApp(audio_output=AUDIO_OUTPUT)
103103
app.run()
104-
except Exception as e:
104+
except Exception as e: # pylint: disable=broad-except
105105
print(f"Error with I2S audio: {e}")
106106

107107
# Force garbage collection
@@ -112,5 +112,5 @@ def run(self):
112112
try:
113113
app = MusicStaffApp(audio_output="pwm")
114114
app.run()
115-
except Exception as e2:
115+
except Exception as e2: # pylint: disable=broad-except
116116
print(f"Fatal error: {e2}")

Fruit_Jam/Larsio_Paint_Music/control_panel.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# SPDX-FileCopyrightText: 2025 John Park and Claude AI for Adafruit Industries
2+
#
3+
# SPDX-License-Identifier: MIT
14
"""
25
# control_panel.py: CircuitPython Music Staff Application component
36
"""

Fruit_Jam/Larsio_Paint_Music/cursor_manager.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# SPDX-FileCopyrightText: 2025 John Park and Claude AI for Adafruit Industries
2+
#
3+
# SPDX-License-Identifier: MIT
14
"""
25
# cursor_manager.py: CircuitPython Music Staff Application component
36
"""

Fruit_Jam/Larsio_Paint_Music/display_manager.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# SPDX-FileCopyrightText: 2025 John Park and Claude AI for Adafruit Industries
2+
#
3+
# SPDX-License-Identifier: MIT
14
"""
25
# display_manager.py: CircuitPython Music Staff Application component
36
"""

Fruit_Jam/Larsio_Paint_Music/input_handler.py

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# SPDX-FileCopyrightText: 2025 John Park and Claude AI for Adafruit Industries
2+
#
3+
# SPDX-License-Identifier: MIT
14
"""
25
# input_handler.py: CircuitPython Music Staff Application component
36
"""
@@ -11,8 +14,8 @@
1114

1215

1316
# pylint: disable=invalid-name,no-member,too-many-instance-attributes,too-many-arguments
14-
# pylint: disable=too-many-branches,too-many-statements,broad-exception-caught
15-
# pylint: disable=too-many-nested-blocks,too-many-locals,too-many-positional-arguments
17+
# pylint: disable=too-many-branches,too-many-statements,broad-except
18+
# pylint: disable=too-many-nested-blocks,too-many-locals,no-self-use
1619
class InputHandler:
1720
"""Handles user input through mouse and interactions with UI elements"""
1821

@@ -62,7 +65,7 @@ def find_mouse(self):
6265
try:
6366
manufacturer = device.manufacturer
6467
product = device.product
65-
except Exception: # Specify exception type
68+
except Exception: # pylint: disable=broad-except
6669
manufacturer = "Unknown"
6770
product = "Unknown"
6871

@@ -74,13 +77,13 @@ def find_mouse(self):
7477
has_kernel_driver = hasattr(device, 'is_kernel_driver_active')
7578
if has_kernel_driver and device.is_kernel_driver_active(0):
7679
device.detach_kernel_driver(0)
77-
except Exception as e:
80+
except Exception as e: # pylint: disable=broad-except
7881
print(f"Error detaching kernel driver: {e}")
7982

8083
# Set configuration
8184
try:
8285
device.set_configuration()
83-
except Exception as e:
86+
except Exception as e: # pylint: disable=broad-except
8487
print(f"Error setting configuration: {e}")
8588
continue # Try next device
8689

@@ -98,7 +101,7 @@ def find_mouse(self):
98101
buf = bytearray(1)
99102
device.ctrl_transfer(bmRequestType, bRequest, wValue, wIndex, buf)
100103
print("Set to report protocol mode")
101-
except Exception as e:
104+
except Exception as e: # pylint: disable=broad-except
102105
print(f"Could not set protocol: {e}")
103106

104107
# Buffer for reading data
@@ -115,14 +118,14 @@ def find_mouse(self):
115118
# Timeout is normal if mouse isn't moving
116119
print("Mouse connected but not sending data (normal)")
117120
return True
118-
except Exception as e:
121+
except Exception as e: # pylint: disable=broad-except
119122
print(f"Mouse test read failed: {e}")
120123
# Continue to try next device or retry
121124
self.mouse = None
122125
self.in_endpoint = None
123126
continue
124127

125-
except Exception as e:
128+
except Exception as e: # pylint: disable=broad-except
126129
print(f"Error initializing device: {e}")
127130
continue
128131

@@ -134,7 +137,7 @@ def find_mouse(self):
134137
gc.collect()
135138
time.sleep(RETRY_DELAY)
136139

137-
except Exception as e:
140+
except Exception as e: # pylint: disable=broad-except
138141
print(f"Error during mouse detection: {e}")
139142
gc.collect()
140143
time.sleep(RETRY_DELAY)
@@ -204,7 +207,7 @@ def process_mouse_input(self):
204207
gc.collect()
205208

206209
return False
207-
except Exception as e:
210+
except Exception as e: # pylint: disable=broad-except
208211
print(f"Error reading mouse: {type(e).__name__}")
209212
return False
210213

Fruit_Jam/Larsio_Paint_Music/note_manager.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# SPDX-FileCopyrightText: 2025 John Park and Claude AI for Adafruit Industries
2+
#
3+
# SPDX-License-Identifier: MIT
14
"""
25
# note_manager.py: CircuitPython Music Staff Application component
36
"""
@@ -8,7 +11,7 @@
811

912
# pylint: disable=invalid-name,no-member,too-many-instance-attributes,too-many-arguments
1013
# pylint: disable=too-many-branches,too-many-statements,protected-access,too-many-locals
11-
# pylint: disable=too-many-positional-arguments, trailing-whitespace
14+
# pylint: disable=trailing-whitespace
1215
class NoteManager:
1316
"""Manages notes, their positions, and related data"""
1417

Fruit_Jam/Larsio_Paint_Music/playback_controller.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# SPDX-FileCopyrightText: 2025 John Park and Claude AI for Adafruit Industries
2+
#
3+
# SPDX-License-Identifier: MIT
14
"""
25
Playback controller for CircuitPython Music Staff Application.
36
Manages the playback state, button displays, and sound triggering.

Fruit_Jam/Larsio_Paint_Music/sound_manager.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# SPDX-FileCopyrightText: 2025 John Park and Claude AI for Adafruit Industries
2+
#
3+
# SPDX-License-Identifier: MIT
14
"""
25
# sound_manager.py: CircuitPython Music Staff Application component
36
"""

Fruit_Jam/Larsio_Paint_Music/sprite_manager.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# SPDX-FileCopyrightText: 2025 John Park and Claude AI for Adafruit Industries
2+
#
3+
# SPDX-License-Identifier: MIT
14
"""
25
Sprite manager for CircuitPython Music Staff Application.
36
Handles loading and managing sprite images and palettes.
@@ -8,7 +11,7 @@
811
from displayio import Palette, TileGrid
912

1013

11-
# pylint: disable=too-many-instance-attributes,invalid-name,broad-exception-caught
14+
# pylint: disable=too-many-instance-attributes,invalid-name,broad-except
1215
class SpriteManager:
1316
"""Manages sprites and palettes for note display"""
1417

Fruit_Jam/Larsio_Paint_Music/staff_view.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# SPDX-FileCopyrightText: 2025 John Park and Claude AI for Adafruit Industries
2+
#
3+
# SPDX-License-Identifier: MIT
14
"""
25
# staff_view.py: Larsio Paint Music component
36
"""

Fruit_Jam/Larsio_Paint_Music/ui_manager.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# SPDX-FileCopyrightText: 2025 John Park and Claude AI for Adafruit Industries
2+
#
3+
# SPDX-License-Identifier: MIT
14
"""
25
# ui_manager.py: CircuitPython Music Staff Application component
36
"""
@@ -21,7 +24,7 @@
2124

2225
# pylint: disable=invalid-name,no-member,too-many-instance-attributes,too-many-arguments
2326
# pylint: disable=too-many-branches,too-many-statements,too-many-public-methods
24-
# pylint: disable=too-many-locals,attribute-defined-outside-init,possibly-used-before-assignment
27+
# pylint: disable=too-many-locals,attribute-defined-outside-init
2528
# pylint: disable=consider-using-in,too-many-return-statements,no-else-return
2629
class UIManager:
2730
"""Manages the UI elements, input, and user interaction"""

0 commit comments

Comments
 (0)