← Back to team overview

sikuli-driver team mailing list archive

[Question #200244]: __main__ changing after using sikuli in python script

 

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

Today I encountered the following behaviour:
I have a python script in eclipse that runs the script with the jython interpreter and has sikuli-script integrated. 

My script looks like this:
test.py

import sys
import sikuli.Sikuli as sikuli
print sys.modules["__main__"]
sikuli.SCREEN.right()
print sys.modules["__main__"]

The output is this:

[info] Sikuli vision engine loaded.
[info] VDictProxy loaded.
<module '__main__' from '/home/jakob/test.py'>
<module '__main__' (built-in)>

So the __main__ module seems to change when SCREEN.right() is executed. 
Is this a known issue and are there any possibilties to work around this?
My script is using sys.modules["__main__"] to determine the "root script". 
This fails after Region.right() is executed because of the above shown problem. 
I don't know which sikuli methods change the __main__ module, click(), type(), wait() and similar are no problem, but the region methods like right() do have this behaviour. 

Any ideas what the source of this problem is and how to solve this problem?

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