[Pydev-code] Web2py helper: Adding imports and parsing models with jython scripting
Brought to you by:
fabioz
From: Álvaro J. I. <air...@gm...> - 2011-04-28 12:36:48
|
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 - air...@gm... |