Skip to content

Commit 600eb79

Browse files
committed
Use int for some coordinates
1 parent fc6fd01 commit 600eb79

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

src/com/dtmilano/android/culebron.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22
"""
3-
Copyright (C) 2012-2022 Diego Torres Milano
3+
Copyright (C) 2012-2023 Diego Torres Milano
44
Created on oct 6, 2014
55
66
Licensed under the Apache License, Version 2.0 (the "License");
@@ -38,7 +38,7 @@
3838
from com.dtmilano.android.uiautomator.uiautomatorhelper import UiAutomatorHelper
3939
from com.dtmilano.android.viewclient import ViewClient, View, VERSION_SDK_PROPERTY
4040

41-
__version__ = '22.6.0'
41+
__version__ = '22.6.1'
4242

4343
import sys
4444
import threading
@@ -94,8 +94,8 @@
9494
DEBUG = False
9595
DEBUG_MOVE = DEBUG and False
9696
DEBUG_TOUCH = DEBUG and False
97-
DEBUG_POINT = DEBUG and False
98-
DEBUG_KEY = DEBUG and False or False
97+
DEBUG_POINT = DEBUG and True
98+
DEBUG_KEY = DEBUG and False
9999
DEBUG_ISCCOF = DEBUG and False
100100
DEBUG_FIND_VIEW = DEBUG and False
101101
DEBUG_CONTEXT_MENU = DEBUG and False
@@ -733,7 +733,7 @@ def findTargets(self):
733733
# if self.vc:
734734
# self.vc.traverse(transform=self.populateViewTree)
735735

736-
def getViewContainingPointAndGenerateTestCondition(self, x, y):
736+
def getViewContainingPointAndGenerateTestCondition(self, x: int, y: int):
737737
if DEBUG:
738738
print('getViewContainingPointAndGenerateTestCondition(%d, %d)' % (x, y), file=sys.stderr)
739739
self.finishGeneratingTestCondition()
@@ -754,13 +754,16 @@ def getViewContainingPointAndGenerateTestCondition(self, x, y):
754754
self.printOperation(v, Operation.TEST, text)
755755
break
756756

757-
def findViewContainingPointInTargets(self, x, y):
757+
def findViewContainingPointInTargets(self, x: int, y: int):
758758
if self.vc:
759759
vlist = self.vc.findViewsContainingPoint((x, y))
760760
if DEBUG_FIND_VIEW:
761761
print("Views found:", file=sys.stderr)
762-
for v in vlist:
763-
print(" ", v.__smallStr__(), file=sys.stderr)
762+
if vlist:
763+
for v in vlist:
764+
print(" ", v.__smallStr__(), file=sys.stderr)
765+
else:
766+
print(f" list is empty. No views found containing point ({x},{y})", file=sys.stderr)
764767
vlist.reverse()
765768
for v in vlist:
766769
if DEBUG:

0 commit comments

Comments
 (0)