web2py and external editors

326 views
Skip to first unread message

Mike Rans

unread,
Jan 18, 2011, 3:11:17 PM1/18/11
to web2py-users
Hi,

I am a web2py newbie.

I am using web2py with an external text editor. I made Pylint and
Winpdb plugins for this editor (Editra - which is written in Python)
and can successfully debug web2py from it.

The problem I have is with Pylint - web2py does some behind the scenes
importing. I don't want to turn warnings off as that defeats the
object of Pylint. I can modify the Pylint plugin to do things before
launching Pylint (and already do so with altering the PYTHONPATH), so
do you know of a way to tell Pylint about the imports web2py has
done?

Cheers,
Mike

Niphlod

unread,
Jan 19, 2011, 4:37:57 PM1/19/11
to web2py-users
never tried but 2 possibilities arise:
- put all imports in the head of the code .... I personally use tips
from http://pierreth.blogspot.com/2010/10/web2py-eclipse-pydev-recipe.html
(search the section starting with "Avoiding warning and errors with
Pydev") with a few variations


- explore the capabilities of pylintrc, init-hook parameter in it and
load the file with --rcfile=<file>

Plumo

unread,
Jan 19, 2011, 9:27:54 PM1/19/11
to web...@googlegroups.com
I use Komodo Edit, and to deal with the imports I made a plugin that executed this implicitly in every Python file:

if 0:
    from gluon.globals import *
    from gluon.html import *
    from gluon.http import *
    from gluon.sqlhtml import SQLFORM, SQLTABLE, form_factory
    session = Session()
    request = Request()
    response = Response()

Mike Rans

unread,
Jan 20, 2011, 5:33:56 PM1/20/11
to web2py-users
Thanks very much Niphlod and Plumo. I will check out these possible
solutions.
Reply all
Reply to author
Forward
0 new messages