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()
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: ath1+"\ \imgs.sikuli\ \" in getImagePath(): # to avoid double action in IDE Path(getImagePa th()[0] ) # removes the wrong entry, remove it if it makes problems h(projectImgsLa bPath1+ "\\imgs. sikuli" ) h(projectImgsLa bPath2+ "\\imgs_ desktopDirector .sikuli"
if not projectImgsLabP
removeImage
addImagePat
addImagePat
the trailing \\ in the if is needed, since the internal logic adds it with addImagePath()
I hope the approach is clear enough.