← Back to team overview

sikuli-driver team mailing list archive

[Question #253709]: Stopping main program flow while a handler is active

 

New question #253709 on Sikuli:
https://answers.launchpad.net/sikuli/+question/253709

For example, lets say we have a simple Script like:

(1)def myHandler(event):
(2)    #code to make popup vanish
(3)   event.region.stopObserver()
	

(4)def func():
(5)    #Main Function code
(6)    onAppear(pImage, myHandler)
(7)   observe(60,background=True)
(8)    wait(5)
(9)    #Continue with main function

The problem i'm having is that the image i'm observing for won't necessarily always appear during automation of a particular GUI app -  in fact most of the time it won't.  The only way I can get this to work is to to put a long wait between the observer action area and the continued flow of the program (9) This however means a needless 5 second pause every time automation is executed and that image/window does not appear. I have tried using various boolean flags but to no avail. Does anyone else have any experience with this? 

Thank you

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.