From 446842b991fd02718907b57bd5bf4d5369b0c00e Mon Sep 17 00:00:00 2001 From: "B. Stack" Date: Mon, 23 Sep 2024 23:44:04 -0400 Subject: initial protection against empty response from get_enrolled_fingers --- fprintd_tk_lib.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'fprintd_tk_lib.py') 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 -- cgit