← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #166280]: AttributeError: 'Region' object has no attribute 'StopObserver'

 

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

Description changed to:
Hello,

I would appreciate your insight on this error, which is reproduced each time I run the sikuli script. 
Sikuli Version:  Sikuli-X-1.0rc2-linux

CODE BLOCK - based on example in documentation:

                      myFileDownloadRegion =  (Region,15,25,1010,698)
                     def myObserverHandler(event):
                              event.region.StopObserver()# stops the observation
                     myFileDownloadRegion.inside().onAppear( '/sikuli/project/UserSecurity.png', myObserverHandler)
<Line 143>myFileDownloadRegion.observe(60)

Error Log:
[error] Stopped [error] An error occurs at line 143 
[error] Error message: Traceback (most recent call last): 
File "/tmp/sikuli-tmp488639225974608907.py", line 143, in   myFileDownloadRegion.observe(60)  
File "/tmp/sikuli-tmp488639225974608907.py", line 143, in   myFileDownloadRegion.observe(60)  
File "/usr/share/sikuli/Sikuli-X-1.0rc2-linux/Sikuli-IDE/sikuli-script.jar/Lib/sikuli/Region.py", line 255, in observe 
File "/usr/share/sikuli/Sikuli-X-1.0rc2-linux/Sikuli-IDE/sikuli-script.jar/Lib/sikuli/Region.py", line 223, in targetAppeared 
File "/tmp/sikuli-tmp488639225974608907.py", line 135, in myObserverHandler event.region.StopObserver()# stops the observation 
AttributeError: 'Region' object has no attribute 'StopObserver'

UPDATE:  I have solved this particular issue.  observe() should be
called without appending the method to the region.

observe(60)

Thanks.
Carla

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