@@ -73,15 +73,14 @@ def fingerprint_check_file():
73
73
set_led_local (color = 2 , speed = 150 , mode = 6 )
74
74
print ("Fingerprint match template in file." )
75
75
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!" )
76
79
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
84
82
83
+ # pylint: disable=too-many-statements
85
84
def enroll_save_to_file ():
86
85
"""Take a 2 finger images and template it, then store it in a file"""
87
86
set_led_local (color = 3 , mode = 1 )
@@ -153,14 +152,14 @@ def enroll_save_to_file():
153
152
154
153
return True
155
154
156
-
155
+ # pylint: disable=broad-except
157
156
def set_led_local (color = 1 , mode = 3 , speed = 0x80 , cycles = 0 ):
158
157
"""this is to make sure LED doesn't interfer with example
159
158
running on models without LED support - needs testing"""
160
159
try :
161
160
finger .set_led (color , mode , speed , cycles )
162
161
except Exception as exc :
163
- print ("INFO: Sensor les not support LED!" )
162
+ print ("INFO: Sensor les not support LED. Error:" , str ( exc ) )
164
163
165
164
166
165
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):
191
190
# turn off LED
192
191
set_led_local (mode = 4 )
193
192
raise SystemExit
194
- elif c == "e" :
193
+ if c == "e" :
195
194
enroll_save_to_file ()
196
195
elif c == "c" :
197
196
fingerprint_check_file ()
0 commit comments