Skip to content

Commit a5897ea

Browse files
More Pylint corrections... :(
1 parent 820d9b7 commit a5897ea

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

adafruit_fingerprint.py

+1
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@
9090
MODULEOK = const(0x55)
9191

9292
# pylint: disable=too-many-instance-attributes
93+
# pylint: disable=too-many-public-methods
9394
class Adafruit_Fingerprint:
9495
"""UART based fingerprint sensor."""
9596

examples/fingerprint_template_file_compare.py

+9-10
Original file line numberDiff line numberDiff line change
@@ -73,15 +73,14 @@ def fingerprint_check_file():
7373
set_led_local(color=2, speed=150, mode=6)
7474
print("Fingerprint match template in file.")
7575
return True
76+
if i == adafruit_fingerprint.NOMATCH:
77+
set_led_local(color=1, mode=2, speed=20, cycles=10)
78+
print("Templates do not match!")
7679
else:
77-
if i == adafruit_fingerprint.NOMATCH:
78-
set_led_local(color=1, mode=2, speed=20, cycles=10)
79-
print("Templates do not match!")
80-
else:
81-
print("Other error!")
82-
return False
83-
80+
print("Other error!")
81+
return False
8482

83+
# pylint: disable=too-many-statements
8584
def enroll_save_to_file():
8685
"""Take a 2 finger images and template it, then store it in a file"""
8786
set_led_local(color=3, mode=1)
@@ -153,14 +152,14 @@ def enroll_save_to_file():
153152

154153
return True
155154

156-
155+
# pylint: disable=broad-except
157156
def set_led_local(color=1, mode=3, speed=0x80, cycles=0):
158157
"""this is to make sure LED doesn't interfer with example
159158
running on models without LED support - needs testing"""
160159
try:
161160
finger.set_led(color, mode, speed, cycles)
162161
except Exception as exc:
163-
print("INFO: Sensor les not support LED!")
162+
print("INFO: Sensor les not support LED. Error:", str(exc))
164163

165164

166165
set_led_local(color=3, mode=2, speed=10, cycles=10)
@@ -191,7 +190,7 @@ def set_led_local(color=1, mode=3, speed=0x80, cycles=0):
191190
# turn off LED
192191
set_led_local(mode=4)
193192
raise SystemExit
194-
elif c == "e":
193+
if c == "e":
195194
enroll_save_to_file()
196195
elif c == "c":
197196
fingerprint_check_file()

0 commit comments

Comments
 (0)