← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #678458]: I can't implement the rest of the function.

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
as Roman already pointed out:

when your function starts and img1 does not exist in that moment, it
will immediately return and do nothing else.

So to get to the lines beginning with the doubleClick, img1 AND
img11/img12 MUST exist, when the function starts.

So the function will only get to your new 2 lines, if img1 AND
img11/img12 are there, when the function starts and later img1 vanishes
before < if exists(a, 0):> is executed. If img1 is still there in that
moment, the function will return without getting to your 2 new lines.

you say: the new 2 lines are completely independent, so IMHO it must look like this:
 
def do(a, b, ab, abc, ef, efg):
    if not exists(a, 0): 
        if exists(ef, 0):
            doubleClick(efg)
            return
        return
    if not exists(ab, 0)):
        return

the rest of the function is only executed if a and ab exist on entry of
the function

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.