Comment 1 for bug 697355

Revision history for this message
RaiMan (raimund-hocke) wrote : Re: Windows: cannot import multiple image libraries in Sikuli X

The internal handling of import .sikuli adds an entry to the internal Image Path (accessible with getImagePath()).

On Windows its buggy and corrupts the last entry in the list (getImagePath()[-1]) if at least one entry exists at time of import. So currently the "images-are-found-automatically"-feature works only with one import.

Using addImagePath() there is a temporary solution, that might help in most cases:

do the following:

- make all your imports as if the problem was not there
this will leave the Image Path in the not usable way

- then (taking the example above) do the following:
if not projectImgsLabPath1+"\\imgs.sikuli\\" in getImagePath(): # to avoid double action in IDE
    removeImagePath(getImagePath()[0]) # removes the wrong entry, remove it if it makes problems
    addImagePath(projectImgsLabPath1+"\\imgs.sikuli")
    addImagePath(projectImgsLabPath2+"\\imgs_desktopDirector.sikuli"

the trailing \\ in the if is needed, since the internal logic adds it with addImagePath()

I hope the approach is clear enough.