← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #186032]: call image inside a class fail

 

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

    Status: Open => Needs information

RaiMan requested more information:
--- first I made some changes to your coding

Class:

from sikuli import *
# from sikuli.Sikuli import * # not needed

class Banners(object):
    # Banner="" # class attribute does not make sense

    def __init__(self, banners = ["no-banner-given.png"]):
        self.Banner = banners

    def searchbanner(self, target):
        wait(self.Banner[target],FOREVER) ##here no recognice the parameter!!
        doubleClick(getLastMatch()) # why search again? (self.Banner[target])

Test case:

from sikuli import *
from sikuli.Sikuli import *
myScriptPath ="C:\\Automation\\Sikuli"
if not myScriptPath in sys.path: sys.path.append(myScriptPath)

import ResourceManager
ResourceManager.repository("W7", "Inxx", "E")#I am using a remote image repo

from BannerClass import Banners
banners= Banners( ['"snaptact_banner.png"','"example2.png"','"example3.png"'])

banners.searchbanner(0)


--- how do you tell Sikuli, where the images are located

import ResourceManager
ResourceManager.repository("W7", "Inxx", "E")#I am using a remote image repo

I do not know what that manages.

I guess, that Sikuli does not find the image files.

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