From 34d2599afe2d5c01689f2955d4a8d21f2380c718 Mon Sep 17 00:00:00 2001 From: jrafaaael Date: Sun, 20 Oct 2024 17:57:05 -0400 Subject: [PATCH] refactor: use `search` instead of `match` --- src/com/dtmilano/android/viewclient.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/com/dtmilano/android/viewclient.py b/src/com/dtmilano/android/viewclient.py index 53a4f6b1..61dbe891 100644 --- a/src/com/dtmilano/android/viewclient.py +++ b/src/com/dtmilano/android/viewclient.py @@ -3955,7 +3955,7 @@ def __findViewWithAttributeInTreeThatMatches(self, attr, regex, root, rlist=[]): if DEBUG: print("__findViewWithAttributeInTreeThatMatches: checking if root=%s attr=%s matches %s" % ( root.__smallStr__(), attr, regex), file=sys.stderr) - if root and attr in root.map and regex.match(root.map[attr]): + if root and attr in root.map and regex.search(root.map[attr]): if DEBUG: print("__findViewWithAttributeInTreeThatMatches: FOUND: %s" % root.__smallStr__(), file=sys.stderr) return root @@ -3981,7 +3981,7 @@ def __findViewsWithAttributeInTreeThatMatches(self, attr, regex, root, rlist=[]) print("__findViewsWithAttributeInTreeThatMatches: checking if root=%s attr=%s matches %s" % ( root.__smallStr__(), attr, regex), file=sys.stderr) - if root and attr in root.map and regex.match(root.map[attr]): + if root and attr in root.map and regex.search(root.map[attr]): if DEBUG: print("__findViewsWithAttributeInTreeThatMatches: FOUND: %s" % root.__smallStr__(), file=sys.stderr) matchingViews.append(root)