← Back to team overview

sikuli-driver team mailing list archive

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

 

** Summary changed:

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

** Changed in: sikuli
    Milestone: 2.0.0 => 2.0.1

-- 
You received this bug notification because you are a member of Sikuli
Drivers, which is subscribed to Sikuli.
https://bugs.launchpad.net/bugs/1545325

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

Status in Sikuli:
  In Progress

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

To manage notifications about this bug go to:
https://bugs.launchpad.net/sikuli/+bug/1545325/+subscriptions


References