[check] Jython scripting: exit() does not work anymore in observe handler function --- workaround

Bug #1545325 reported by RaiMan
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SikuliX
In Progress
Medium
RaiMan

Bug Description

------- workaround
use
os._exit()
instead of
exit()

caveat: if running in IDE, this will also terminate the IDE. So take care to save your stuff before running.
You might also run the script from commandline (while still editing it in the IDE).

----------------------------------

I am using onAppear to catch a specific image on the screen. Once the image is there, I want the script to stop. I've been using exit() command for that. However, once I updated to ver. 1.1.0, exit() command is being omitted. The scripts executes until that command, and then ignores it and proceeds.
How I can stop scipt's execution under hanlder for onAppear?

def __onAppearForTheImage(self):
self.__reg.onAppear("imgPath", self.__handlerForTheImage)
self.__reg.observeInBackground(FOREVER)

def __handlerForTheImage(self, event):
print "Image found"
exit() # Ignores that line

RaiMan (raimund-hocke)
Changed in sikuli:
status: New → In Progress
importance: Undecided → Medium
assignee: nobody → RaiMan (raimund-hocke)
milestone: none → 1.1.1
description: updated
RaiMan (raimund-hocke)
summary: [1.1.0] Jython scripting: exit() does not work anymore in observe
- handler function
+ handler function --- workaround
Changed in sikuli:
milestone: 1.1.1 → 2.0.0
RaiMan (raimund-hocke)
summary: - [1.1.0] Jython scripting: exit() does not work anymore in observe
+ [check] Jython scripting: exit() does not work anymore in observe
handler function --- workaround
Changed in sikuli:
milestone: 2.0.0 → 2.0.1
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related questions

Remote bug watches

Bug watches keep track of this bug in other bug trackers.