addImagePath() not changing the ImagePath

Asked by aidma

When I addImagePath(path) using a Jython script I encounter odd behavior. The following example is from the interactive Jython console, but the same error occurs when I try to run scripts via Eclipse.

>>> import org.sikuli.basics.SikulixForJython
>>> from sikuli import *
>>> getImagePath()
[]
>>> addImagePath("C:\\Users\\aidma")
>>> getImagePath()
[]
>>> ImagePath.add("C:\\Users\\aidma")
False
>>> getImagePath()
[]

As you can see, the imagePath() is not being modified.
Interestingly, the imagePath *does* change when I getBundlePath():

>>> getImagePath()
[]
>>> getBundlePath()
u'/C:'
>>> getImagePath() #Why would getting a value change a value?
[u'/C:/']

All and any advice on how to properly set the imagePath via Jython is appreciated. Thanks!

_____ EXTRA INFO! _____
When I addImagePath(path) using the SikulixIDE everything works as expected. The script:

     addImagePath("C:\\Users\\aidma")
     print getImagePath()

Results in the output:

     SikuliScriptsImagePathTest.sikuli', u'C:/Users/aidma''>[u'C:/SikuliScripts/ImagePathReader.sikuli', u'C:/Users/aidma']

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
aidma
Solved:
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

still using the special pre-final 1.1.0?

looks strange indeed.

Revision history for this message
aidma (aidan-mahler13) said :
#2

Oof.

You're right. addImagePath(path) works fine with the 1.1.0 2015-01-16_01:00nightly.