Showing posts with label tvtk. Show all posts
Showing posts with label tvtk. Show all posts

Saturday, June 21, 2008

Configuring tvtk / forced builtins

Recently, there was a report on problems while configuring tvtk (it's a pythonic API over vtk).

Having the import:

from enthought.tvtk.api import tvtk


did not bring any completions while later using 'tvtk.' on that module.

This happens because the code in tvtk does some black-magic to load the classes in that module... there's a module called enthought.tvtk.tvtk that has a class tvtk that's actually what's imported in "from enthought.tvtk.api import tvtk", so, the solution is adding "enthought.tvtk.tvtk.tvtk" to the "forced builtins", so that pydev can understand that it should be dynamically analyzed.

More info on the "forced builtins" can be found at: http://www.fabioz.com/pydev/manual_101_interpreter.html... and yes: finding out what should be dynamically analyzed and what shouldn't can be very tricky some times...