Might be easier providing predefined completions (i.e.: generating
python stub code for web2py -- you can create a Python script that
loads the environment and extracts info as needed).

See: http://pydev.org/manual_101_interpreter.html#id2 for details

An example script that converts QScintilla .api files to the
predefined completions is available at:
https://github.com/aptana/Pydev/blob/master/plugins/org.python.pydev.jython/jysrc/convert_api_to_pypredef.py
(this file should also be in your local PyDev)

Cheers,

Fabio

On Thu, Apr 28, 2011 at 9:36 AM, Álvaro J. Iradier <airad...@gmail.com> wrote:
> Hi all,
>
> I'm trying to make a Jython Script for Pydev for better integration
> with web2py development.
>
> Basically, I need some way to access the python interpreter that is
> used for syntax check and code completion from the jython script.
>
> What I would like to do is, when a .py file for a web2py project is
> loaded in the editor, fist, make some imports into the current
> interpreter, for example:
>
> from gluon.globals import Request
> from gluon.globals import Session
> from gluon.globals import Response
>
> then instantiate some of this classes into global variables:
>
> request=Request()
> session=Session()
> response=Response()
>
> to simulate a real request environment.
>
> Finally, I want to "exec" all the files in the models/ folder, in
> order to have the globals declared in there into de interpreter.
>
> Can you guide me into the right path? I'm totally lost looking at the
> code in com.python.pydev.codecompletion... I don't know how to get
> there from the jython script (or even if it's possible).
>
> Thanks very much.
>
> --
>
> (:=================================:)
>  Alvaro J. Iradier Muro - airad...@gmail.com
>
> ------------------------------------------------------------------------------
> WhatsUp Gold - Download Free Network Management Software
> The most intuitive, comprehensive, and cost-effective network
> management toolset available today.  Delivers lowest initial
> acquisition cost and overall TCO of any competing solution.
> http://p.sf.net/sfu/whatsupgold-sd
> _______________________________________________
> pydev-code mailing list
> pydev-code@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/pydev-code
>

------------------------------------------------------------------------------
WhatsUp Gold - Download Free Network Management Software
The most intuitive, comprehensive, and cost-effective network 
management toolset available today.  Delivers lowest initial 
acquisition cost and overall TCO of any competing solution.
http://p.sf.net/sfu/whatsupgold-sd
_______________________________________________
pydev-code mailing list
pydev-code@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pydev-code

Reply via email to