sikuli-driver team mailing list archive
-
sikuli-driver team
-
Mailing list archive
-
Message #31850
Re: [Question #265514]: List, object has no attribute 'hasNext'
Question #265514 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/265514
Status: Answered => Open
Maks is still having a problem:
Eugene S (shragovich), thanks for your answer.
I've tried to use Finder():
def order(match):
return match.y, match.x
def CLICKER():
scr1 = Screen(1)
f = Finder ("1429541887831.png")
pat = Pattern("1429518580337.png").similar(0.95)
icons = scr1.findAll(pat)
sorted_icons = sorted(icons, key=order)
f.findAll("1429541926757.png")
for icon in sorted_icons:
print icon
print f.hasNext()
if f.hasNext() == True:
scr1.click(icon)
f.next()
CLICKER(),
break
CLICKER()
Result the same - clicks on all images including the last. It's obvios, statement (if.hasNext() == True) is always TRUE, because each iteration Finder() is the same. I'll try to use Count, but it's not so interesting.
Maybe is there a possibility to make screen of monitor each iteration and use it as Finder()?
Thanks.
--
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.