Skip to content

Commit

Permalink
Merge pull request #331 from jrafaaael/refactor/use-search-instead-of…
Browse files Browse the repository at this point in the history
…-match-to-look-for-attr-that-match

refactor: use `search` instead of `match` to look for attr that match
  • Loading branch information
dtmilano authored Oct 21, 2024
2 parents 9be41ba + 34d2599 commit 2971f5f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/com/dtmilano/android/viewclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down

0 comments on commit 2971f5f

Please sign in to comment.