← Back to team overview

sikuli-driver team mailing list archive

[Question #263790]: Tricks for using pylint with Sikuli?

 

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

I'm a vim user and have the syntastic plugin for it to run pylint.  Sikuli causes problems for pylint which some I've been able to workaround and others I'm wondering if anyone has any thoughts on.
The first problem is with importing other Sikuli scripts.  Since Sikuli uses subfolders to keep scripts and images together, pylint doesn't understand this structure and can't follow the import statements.  To work around this, I create hardlinks to the scripts from the parent folder and open the scripts in vim using those.  This allows pylint to find the other scripts since they now all reside in the same folder.
The next problem is pylint recognizing Sikuli functions themselves.  At the top of my scripts I explicitly 'from sikuli.Sikuli import *', but again, pylint can't follow this.  If I create a folder 'sikuli' with an init file and a file called 'Sikuli.py', this becomes a file pylint can find, but Sikuli will ignore since it's not in its import path.  In the Sikuli.py, I add stubbed out definitions for the various Sikuli features which allows pylint to know Sikuli's syntax.  It would be nice to have an easy way to generate this, but the API isn't huge so it's not bad.
I'm curious if anyone has ideas on better/easier ways to do this?

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