aboutsummaryrefslogtreecommitdiff
path: root/fprintd_tk_lib.py
diff options
context:
space:
mode:
authorB. Stack <bgstack15@gmail.com>2024-09-23 23:44:04 -0400
committerB. Stack <bgstack15@gmail.com>2024-09-23 23:44:04 -0400
commit446842b991fd02718907b57bd5bf4d5369b0c00e (patch)
tree00b22e2a14ff0ba4f5295c3baf460495d5979c68 /fprintd_tk_lib.py
parentprogress for day (diff)
downloadfprintd-tk-446842b991fd02718907b57bd5bf4d5369b0c00e.tar.gz
fprintd-tk-446842b991fd02718907b57bd5bf4d5369b0c00e.tar.bz2
fprintd-tk-446842b991fd02718907b57bd5bf4d5369b0c00e.zip
initial protection against empty response from get_enrolled_fingers
Diffstat (limited to 'fprintd_tk_lib.py')
-rw-r--r--fprintd_tk_lib.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/fprintd_tk_lib.py b/fprintd_tk_lib.py
index f4947ec..bd8b145 100644
--- a/fprintd_tk_lib.py
+++ b/fprintd_tk_lib.py
@@ -34,12 +34,14 @@ def get_enrolled_fingers(user = None):
if fre.match(line):
#print(f"Got {fre.match(line).groups()[0]}")
enrolled_fingers.append(fre.match(line).groups()[0].strip())
+ elif re.match("^.*No devices available.*", line):
+ # WORKHERE: we should rerun the program in a second or two
+ return []
else:
#print(f"Not-matching: {line}",end="")
pass
return enrolled_fingers
-# WORKHERE: count duplicate lines as before, and also save last line, so we can prepend "succeeded"?
def fprintd_action(action, finger, status_function = None, user = None):
if user is None:
user = _user
bgstack15