views:

271

answers:

2

I've been using Pydev/Eclipse to develop Google App Engine (GAE) applications but I've been unable to get the response/request objects from WebOb to have auto-completion. I used a widely recommended tutorial to get everything configured; auto-completion is working for everything else I've run into.

As an example: if I type in "self." I get auto-completion for response and request; if I select one of those, say "response", and add a "." (bringing the full line to "self.response." thus far) I don't get any options - since the WebOb library is included, I would expect to get things like "out.write()" as an option.

I'm including the following libraries into my Pydev project:

  • C:\Program Files\Google\google_appengine
  • C:\Program Files\Google\google_appengine\lib\django
  • C:\Program Files\Google\google_appengine\lib\webob
  • C:\Program Files\Google\google_appengine\lib\yaml\lib

Any help would be much appreciated, thanks.

+2  A: 

I have tried on my installation, and it works. However, bear in mind that PyDev's analysis stops whenever it encounters an error, and this could be a reason why autocompletion is not working in your case.

I would suggest you getting in contact with the main developer, Fabio Zadrozny; he is very friendly and helpful, and also runs a blog with many useful tips for configuring PyDev with various framework, and all limitations.

Roberto Liffredo
A: 

Apparently this is a known issue with various Python IDEs - and no one seems to have a singular solution. Google changed some internal pathing such that it can only really be determined by executing the python scripts. I haven't been able to come up with a satisfactory solution for Pydev, though there is a decent work-around for the Wing IDE:

Improving Auto-Completion and Goto-Definition

Wing can't parse the sys.path hackery in more recent versions of Google App Engine so it may fail to find some modules for auto-completion, goto-definition and other features. To work around this, set a breakpoint in fix_sys_path in dev_appserver.py and start debugging.

Then, in the Debug Probe tool (in Wing Pro only) type the following:

os.pathsep.join(EXTRA_PATHS)

Copy this to the clipboard and open up the file properties for dev_appserver.py by right-clicking on the file. Then, under the Environment tab select Custom for the Python Path, click on the View as Text button and paste in the extra path.

You will need to redo this if you move the app engine installation, or you can use ${WING:PROJECT_DIR} to convert those paths to base on the location of the project file.

(Taken from: http://www.wingware.com/doc/howtos/google-app-engine)

Goyuix