← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #267998]: Push/Pop and addImagePath

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
With Python scripting and SikuliX, the smoothest way to organise your
images is the following:

what you name a context can be a module named someContext.sikuli,
containing:

img1 = "someImage.png"
img1P1 = Pattern(img1).exact() #optional
img1P2 = Pattern(img1P1).targetOffset(x, y) #optional

the variableness of course should be along some naming convention and
"speaking" to some extent.

Having such a module you now can do the following in your main workflow:

import someContext

click(someContext.img1P2)

now you have separated code and images.

With the latest build of 1.1.0 this is supported in the IDE:

write in a blank line
someImage = 

leave the cursor in that line, press the capture button and capture.
Coming back to the IDE, you will see that the image file is named "someImage.png" automatically.
Repeating the action (e.g. to optimise the image shot) the image file will be overwritten without notice (which is what one would expect)

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