[1.0.1] Finder.find(): only finds one match --- use Finder.findAll() to find more than one --- docs fixed

Bug #1445940 reported by RaiMan
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SikuliX
Fix Committed
Critical
RaiMan

Bug Description

---------- fixed 2015-04-19

the docs are not showing the API and behaviour with 1.1.0

the docs for version 1.1.0:
http://sikulix-2014.readthedocs.org/en/latest/index.html

----------------------------------------------------------

I am using Sikulix 1.1.0 (2015-01-16_01:00nightly) on win 7
I try to implement the codes on example 2 of http://doc.sikuli.org/finder.html

f = Finder("stars.png")
img = "star.png"
f.find(img)
mm = []
while f.hasNext():
    mm.append(f.next())
print f.hasNext()
f.destroy()
print len(mm)
for m in mm:
    print m

The result is supposed to be 5 matches. However, I only get
1
M[30,32 23x23]@S(S(0)[0,0 1920x1080]) S:1.00 C:41,43 [0/0 msec]

Please help.
Thanks.

RaiMan (raimund-hocke)
Changed in sikuli:
status: New → Fix Committed
importance: Undecided → High
assignee: nobody → RaiMan (raimund-hocke)
milestone: none → 1.1.0
Revision history for this message
RaiMan (raimund-hocke) wrote :

ok, checked again and looked into the code:
this is simply a doc-bug.

with version 1.1.0 I changed the behaviour and the API, to be consistent with the Region.find()/findAll():
Finder.find() by intention only finds one match and then returns.

Finder.findAll()
does what you expect.

the example should look like this:

f = Finder("stars.png")
img = "star.png"
f.findAll(img)
mm = []
while f.hasNext():
    mm.append(f.next())
f.destroy()
print len(mm)
for m in mm:
    print m

summary: - [1.0.1] Finder: seems to only find one match
+ [1.0.1] Finder.find(): only finds one match --- use Finder.findAll() to
+ find more than one
description: updated
RaiMan (raimund-hocke)
Changed in sikuli:
importance: High → Critical
summary: [1.0.1] Finder.find(): only finds one match --- use Finder.findAll() to
- find more than one
+ find more than one --- docs fixed
description: updated
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.