Skip to content

Commit 58c4c77

Browse files
committed
remove pylint disables
1 parent de1a06b commit 58c4c77

5 files changed

+15
-17
lines changed

adafruit_ov5640/__init__.py

+8-10
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@
2424
https://github.com/adafruit/circuitpython/releases
2525
"""
2626

27-
# pylint: disable=too-many-lines
28-
# pylint: disable=too-many-public-methods
2927
# imports
3028
import time
3129

@@ -955,7 +953,7 @@ def __set__(self, obj: "OV5640", value: int) -> None:
955953
obj._write_register16(self.reg, reg_value)
956954

957955

958-
class _SCCB16CameraBase: # pylint: disable=too-few-public-methods
956+
class _SCCB16CameraBase:
959957
_finalize_firmware_load = (
960958
0x3022,
961959
0x00,
@@ -1029,7 +1027,7 @@ def _write_reg_bits(self, reg: int, mask: int, enable: bool) -> None:
10291027
self._write_register(reg, val)
10301028

10311029

1032-
class OV5640(_SCCB16CameraBase): # pylint: disable=too-many-instance-attributes
1030+
class OV5640(_SCCB16CameraBase):
10331031
"""Control & Capture Images from an OV5640 Camera"""
10341032

10351033
def __init__(
@@ -1046,7 +1044,7 @@ def __init__(
10461044
i2c_address: int = 0x3C,
10471045
size: int = OV5640_SIZE_QQVGA,
10481046
init_autofocus: bool = True,
1049-
): # pylint: disable=too-many-arguments
1047+
):
10501048
"""
10511049
Args:
10521050
i2c_bus (busio.I2C): The I2C bus used to configure the OV5640
@@ -1169,7 +1167,7 @@ def autofocus_status(self):
11691167
"""Read the camera autofocus status register"""
11701168
return self._read_register(_OV5640_CMD_FW_STATUS)
11711169

1172-
def _send_autofocus_command(self, command, msg): # pylint: disable=unused-argument
1170+
def _send_autofocus_command(self, command, msg):
11731171
self._write_register(_OV5640_CMD_ACK, 0x01) # clear command ack
11741172
self._write_register(_OV5640_CMD_MAIN, command) # send command
11751173
for _ in range(1000):
@@ -1260,7 +1258,7 @@ def colorspace(self, colorspace: int) -> None:
12601258
self._colorspace = colorspace
12611259
self._set_size_and_colorspace()
12621260

1263-
def _set_image_options(self) -> None: # pylint: disable=too-many-branches
1261+
def _set_image_options(self) -> None:
12641262
reg20 = reg21 = reg4514 = reg4514_test = 0
12651263
if self.colorspace == OV5640_COLOR_JPEG:
12661264
reg21 |= 0x20
@@ -1331,7 +1329,7 @@ def size(self) -> int:
13311329
"""Get or set the captured image size, one of the ``OV5640_SIZE_`` constants."""
13321330
return self._size
13331331

1334-
def _set_size_and_colorspace(self) -> None: # pylint: disable=too-many-locals
1332+
def _set_size_and_colorspace(self) -> None:
13351333
size = self._size
13361334
width, height, ratio = _resolution_info[size]
13371335
self._w = width
@@ -1385,7 +1383,7 @@ def _set_size_and_colorspace(self) -> None: # pylint: disable=too-many-locals
13851383

13861384
self._set_colorspace()
13871385

1388-
def _set_pll( # pylint: disable=too-many-arguments
1386+
def _set_pll(
13891387
self,
13901388
bypass: bool,
13911389
multiplier: int,
@@ -1396,7 +1394,7 @@ def _set_pll( # pylint: disable=too-many-arguments
13961394
pclk_manual: bool,
13971395
pclk_div: int,
13981396
) -> None:
1399-
if ( # pylint: disable=too-many-boolean-expressions
1397+
if (
14001398
multiplier > 252
14011399
or multiplier < 4
14021400
or sys_div > 15

examples/ov5640_directio_kaluga1_3_ili9341.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -131,21 +131,21 @@ def contrast_modes(cam_obj):
131131
yield
132132
cam_obj.contrast = 0
133133

134-
def white_balance_modes(cam_obj): # pylint: disable=unused-variable
134+
def white_balance_modes(cam_obj):
135135
for i in ["AUTO", "SUNNY", "FLUORESCENT", "CLOUDY", "INCANDESCENT"]:
136136
print(f"White Balance {i}")
137137
cam_obj.white_balance = getattr(adafruit_ov5640, f"OV5640_WHITE_BALANCE_{i}")
138138
yield
139139
cam_obj.white_balance = adafruit_ov5640.OV5640_WHITE_BALANCE_AUTO
140140

141-
def exposure_value_modes(cam_obj): # pylint: disable=unused-variable
141+
def exposure_value_modes(cam_obj):
142142
for i in range(-3, 4):
143143
print(f"EV {i}")
144144
cam_obj.exposure_value = i
145145
yield
146146
cam_obj.exposure_value = 0
147147

148-
def nite_modes(cam_obj): # pylint: disable=unused-variable
148+
def nite_modes(cam_obj):
149149
print("Night Mode On")
150150
cam_obj.night_mode = True
151151
print(cam_obj.night_mode)

examples/ov5640_jpeg_kaluga1_3.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
print("Wrote to CIRCUITPY/cam.jpg")
7979
print("Resetting so computer sees new content of CIRCUITPY")
8080
time.sleep(0.5)
81-
microcontroller.reset() # pylint: disable=no-member
81+
microcontroller.reset()
8282

8383
except OSError as e:
8484
print(e)

examples/ov5640_jpeg_kaluga1_3_boot.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
V_RECORD = 2.41
1818

1919
a = analogio.AnalogIn(board.IO6)
20-
a_voltage = a.value * a.reference_voltage / 65535 # pylint: disable=no-member
20+
a_voltage = a.value * a.reference_voltage / 65535
2121
print("measured voltage", a_voltage)
2222
if abs(a_voltage - V_MODE) < 0.05: # If mode IS pressed...
2323
print("storage writable by CircuitPython")

examples/ov5640_sdcard_kaluga_1_3.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ def open_next_image():
108108
while True:
109109
pixel[0] = 0x0000FF
110110
pixel.write()
111-
a_voltage = a.value * a.reference_voltage / 65535 # pylint: disable=no-member
111+
a_voltage = a.value * a.reference_voltage / 65535
112112
record_pressed = abs(a_voltage - V_RECORD) < 0.05
113113
if record_pressed:
114114
pixel[0] = 0xFF0000
@@ -131,5 +131,5 @@ def open_next_image():
131131
except OSError as e:
132132
print(e)
133133
while record_pressed:
134-
a_voltage = a.value * a.reference_voltage / 65535 # pylint: disable=no-member
134+
a_voltage = a.value * a.reference_voltage / 65535
135135
record_pressed = abs(a_voltage - V_RECORD) < 0.05

0 commit comments

Comments
 (0)