← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #163900]: Function to select image dict.

 

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

    Status: Answered => Solved

Calle Rundgren confirmed that the question is solved:
Thank you, the information you provided was useful in order to come up
with a solution.

I got three dicts:

theImageDictHiRes
theImageDictMeRes
theImageDictLoRes

In the file where the test is runned from I made this solution.

dictHiRes = sikuliWrapper.ImageDict(guiMapSikuli.theImageDictHiRes)
dictMeRes = sikuliWrapper.ImageDict(guiMapSikuli.theImageDictMeRes)
dictLoRes = sikuliWrapper.ImageDict(guiMapSikuli.theImageDictLoRes)

And use for example: dictHiRes.getImage("MyButton")

In order to use the image "myButton" from my dict theImageDictHiRes.

getImage is a function in a class I got stored in another file. The
class looks like this:

class ImageDict():
    def __init__(self, imageSet):
        self.images = imageSet
    def getImage(self, imageName):
        return self.images[imageName]

Do you think this is a suitable solution? at least it is working fine
for the purpose so far ;-)

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