Monday, June 09, 2008

Google AppEngine code completion for Komodo Mac OS X

Komodo Edit is a nice, free, IDE for Python (as well as a lot of other languages). It does syntax highlighting and code completion. To get code completion to work in Mac OS X for the Google App Engine SDK, you have to know where the appengine python libs are. They are hidden away inside /Applications/GoogleAppEngineLauncher.app, so not normally accessible via the Finder's browse boxes. What I did was to symlink to the libraries inside my user directory and point Komodo there. Like this (in Terminal):

cd <your user home directory>
ln -s /Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine google_appengine


Now you should be able to go to Komodo's preferences, select Languages, then Python, then Additional Python Import Directories and add your symlinked google_appengine directory. Hey presto - code completion.

UPDATE: Newer versions of the app engine launcher create a symlink to the SDK in /usr/local/google_appengine, so you can point Komodo there instead.

3 comments:

  1. Hmmm, been trying to figure out how to do that. Tried what you said. However I have no google_appengine in the resource dir.
    Confused.
    Maybe it's because I installed the SDK before the launcher app, or maybe it's because I'm on 10.4? Going to search for the lib...

    ReplyDelete
  2. I'm using the app engine SDK 1.1, I don't know if that makes a difference. Have you used the launcher at all? I think it unzips something into that directory on startup (there was a google_appengine.zip in the resources directory for me as well).

    ReplyDelete
  3. Hurrah, found it deeper, inside the GoogleAppEngine-default.bundle.

    Now I (eventually, when my old mac gets round to it) have code completion.

    Thanks for the tip.

    ReplyDelete