From: Ben W. <be...@sa...> - 2008-12-16 18:54:52
|
Johan Hake wrote: > On Tuesday 16 December 2008 01:39:43 Ben Webb wrote: >> Is it possible when building multiple modules and wrapping for Python to >> get Python imports that are a) correct and b) absolute? ... >> Are there any other more elegant solutions to this problem? > > Yes there is! You should use the package="foo" option in the module directive. > > <http://www.swig.org/Doc1.3/Python.html#Python_nn72> > > Unfortunalty there is a bug in the present stable version, which cause an > erronious import statment in the generated python file. Instead of calling > > import foo.a > > it calls just, > > import a > > This is fixed in the development version, i.e, in the svn tree. Thanks! That does exactly what I need as designed. It's unfortunate that it doesn't work in the stable releases though, because right now we can't use anything later than SWIG 1.3.34 for our builds (short of building our own patched versions) due to bug #2380788. So if no other simple solutions present themselves, I guess we'll have to use one of the ugly ones until the stable versions are fixed. Ben -- be...@sa... http://salilab.org/~ben/ "It is a capital mistake to theorize before one has data." - Sir Arthur Conan Doyle |