[1.0.1] observe function problem with onChange() - its a bug

Asked by JamyTseng

Hi,
My environment is
windows xp + JRE 6 update 45
I had test the code in official document
def changed(event):
        print "something changed in ", event.region
        for ch in event.changes:
                ch.highlight() # highlight all changes
        sleep(1)
        for ch in event.changes:
                ch.highlight() # turn off the highlights
with selectRegion("select a region to observe") as r:
    # any change in r larger than 50 pixels would trigger the changed function
    onChange(50, changed)
    observe(background=True)

wait(30) # another way to observe for 30 seconds
r.stopObserver()

when I use old version of sikuli (1.0RC3)
everything work fine,

but when I use version 1.0.1
will always get error message
[error] script [ sikulitest ] stopped with error in line 11 <--observe(background=True)
[error] java.lang.NullPointerException ( java.lang.NullPointerException )

I also tried on windows 7 64 bit + JRE7
have the same error,

is it a bug in version 1.0.1

or observe will be use in different way in new version?

Question information

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

Yes, it is bug.

Half solved: the change observation works.

second half: the script does not continue after the observe.

So I have to debug further. Sorry. But I guess it is not a big problem.
I will make this a bug, so you will get notified, when it is solved.
Just run the setup again then.

Revision history for this message
JamyTseng (jamy1978) said :
#2

HI RaiMan,
thanks for the quick response : )

Revision history for this message
JamyTseng (jamy1978) said :
#3

Thanks RaiMan, that solved my question.