← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #261129]: IntelliJ IDEA 14.02 unresolved references after import [from sikuli import *]

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
this is by intention/design or however you name it and cannot be solved,
when you are using the undotted Region and Screen ,methods outside the
Sikuli IDE in other IDE's having auto-complete and continous
compile/syntax check.

a method use like
click(some_image)

is dynamically at runtime interpreted as
SCREEN.click(some_image)

where SCREEN is a constant object created as Screen() internally.

So any compile time engine MUST produce these errors.

Your solution is the worst possible though, since it leads to a mix of
Python level and Java level Region objects, which still might lead to
strange situations.

If you want to be strict, you have to set aside the usage of undated
methods completely and script "normally"

for all actions not bound to a specific region:

SCREEN.click()

or once at the beginning
s = Screen()

and later:
s.click()
s.wait()

...

Everything needed is already imported by 
from sikuli import *

... never import anything from the Java level from the classes Region or
Screen, because these classes are overwritten/wrapped on the Python
level.

I hope, I find a better solution for version 2. But any solution will not allow to use undotted methods in other IDE's than the Sikuli IDE.
So start today, to live without it, if you want to use IntelliJ.

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