← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #162409]: findAll() makes 10 attempts before giving up?

 

Question #162409 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/162409

    Status: Open => Answered

RaiMan proposed the following answer:
It seems, that you have set your AutoWaitTimeout for the region
checkzone to a higher value (i guess 10 seconds).

If this is your intention you should "copy" region checkzone, reduce the
AutoWaitTimeout and use this region only for the findAll()

checkzone_fast = Region(checkzone)
checkzone_fast.setAutoWaitTimeout(0) # only one try per find

for filename in somelist:
 go_on = False
 try:
  bqr = Pattern(filename)
  bqr = bqr.similar(0.95)
  checkzone_fast.findAll(bqr)
  bMatch = checkzone_fast.getLastMatches()

another possibility might be:

for filename in somelist:
 go_on = False
 try:
  bqr = Pattern(filename)
  bqr = bqr.similar(0.95)
  if exists(bqr, 0):
   checkzone.findAll(bqr)
   bMatch = checkzone.getLastMatches()

so the findAll() would only be performed if at least one bqr is there.



-

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.