Region.observe(10) throws error in Region.py

Asked by msansregret

Hey there,

I'm trying to use an observer for the first time so maybe this is me doing something wrong, but I haven't been able to figure it out.

After setting up my region and the onAppear observation and my event handler function. I call observe with a time of 10 and it gives me an error on execution:

File "/Applications/SikuliX.app/Contents/Java/sikulix.jar/Lib/sikuli/Region.py", line 47, in observe
    return JRegion.observeJ(waitTime, background)
TypeError: observeJ(): expected 3 args; got 2

I'm using 1.1.1 (2016-06-08_01:00nightly) on OSX 10.11.5

Question information

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

apparently a bug.
I will fix it the next days.

as a workaround you can use this:

reg = Region(...) # defines a new Region
reg.observeJ(time, trueOrFalse)

# always both parameters are needed
time = observe time in seconds
trueOrFalse = True for observe in background, False for normal inline observe

Revision history for this message
msansregret (msansregret) said :
#2

Cool thanks RaiMan.

Can you help with this problem?

Provide an answer of your own, or ask msansregret for more information if necessary.

To post a message you must log in.