X 1.0rc1 Windows: second import corrupts image search path - workaround
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SikuliX |
Fix Released
|
Critical
|
RaiMan |
Bug Description
****** this happens
--- only one import works fine
--- after adding another import, things contained in first import make problems now and things from second import do not function at all
*******
Hi,
Sikuli-X provides the way to import another Sikuli script and image library into the main sikuli script. It only works on 1 image library importing.
What if I want to import multiple image libraries into the same sikuli script?
I've tried to do that, it won't work on the 2nd import, even it didn't complain anything. It just couldn't find the image and will time out.
I've tried to print out the image search path by getImagePath(), it looks like this, does it look right to you?
array(java.
the 2nd imported images will not be recognized by Sikuli. But if I removed the 1st import, the 2nd import will work fine.
I'm using these codes to import the images from 2 libraries....
projectImgsLabP
if not projectImgsLabPath1 in sys.path: sys.path.
from imgs import *
projectImgsLabP
if not projectImgsLabPath2 in sys.path: sys.path.
from imgs_desktopDir
summary: |
- cannot import multiple image libraries in sikuli + cannot import multiple image libraries in Sikuli X |
summary: |
- cannot import multiple image libraries in Sikuli X + Windows: cannot import multiple image libraries in Sikuli X |
Changed in sikuli: | |
milestone: | none → x1.0-rc2 |
Changed in sikuli: | |
status: | New → Fix Committed |
summary: |
- Windows: cannot import multiple image libraries in Sikuli X + X 1.0rc1 Windows: cannot import multiple image libraries in Sikuli X |
summary: |
- X 1.0rc1 Windows: cannot import multiple image libraries in Sikuli X + X 1.0rc1 Windows: multiple import corrupts image search path - + workaround |
description: | updated |
summary: |
- X 1.0rc1 Windows: multiple import corrupts image search path - - workaround + X 1.0rc1 Windows: second import corrupts image search path - workaround |
Changed in sikuli: | |
assignee: | nobody → RaiMan (raimund-hocke) |
milestone: | x1.0-rc2 → x1.0 |
importance: | Undecided → Low |
tags: | added: fkt-import |
Changed in sikuli: | |
importance: | Low → High |
Changed in sikuli: | |
importance: | High → Critical |
Changed in sikuli: | |
status: | Fix Committed → Fix Released |
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.