← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #207264]: Setting Default Region?

 

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

    Status: Open => Answered

j proposed the following answer:
I would do this (add an additional parameter to the method):

eitherOr(myRegion, imageList)

def eitherOr(myRegion, imageList):
        for x in range(0, len(imageList)):
            print x
            if(myRegion.exists(imageList[x], 0)):
                return imageList[x]


or this (set default region to another region):
oldSCREEN = SCREEN
SCREEN = myRegion

eitherOr(imageList)

def eitherOr(imageList):
        for x in range(0, len(imageList)):
            print x
            if(myRegion.exists(imageList[x], 0)):
                return imageList[x]

# if needed, set default region back to old default region.
SCREEN = oldSCREEN

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