← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #174047]: Exception in thread "Thread-13" java.lang.OutOfMemoryError: Java heap space

 

Question #174047 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/174047

RaiMan posted a new comment:
The only things I can see in your snippet:
- preperation and observing are put together in one def
- 2 independent events are observed with one observer

I would do it this way:

# preparation only once per script run
self.caseEulaDialog = Screen()
self.caseEulaDialog.onAppear( self.getAppImgPath() + "eulaDialog.png", self.__eulaDialogFound )
self.caseSignInDialog = Screen()
self.caseSignInDialog.onAppear( self.getAppImgPath() + "signInDialog.png", self.__signInDialogFound )

# the handlers should contain an event.region.stopObserver(), when they have done their job
# I guess you somehow check later, wether the events have happened (if needed)

later on in your workflow you need to only run the needed observations:
self.caseEulaDialog.observe(timeout, True)
self.caseSignInDialog.observe(timeout, True)

the observations will either stop at the timeout or will be stopped by
the handlers

this can be repeated as needed.

just quick and dirty - you have to adapt this to your class concept.
your observed-region-container is not needed at all.

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