Add optional moduleimport attribute to %module so that the default module import code can be overridden. See the "Searching for the wrapper module" documentation in Python.html. Example: %module(moduleimport="import _foo") foo $module also expands to the low-level C/C++ module name, so the following is the same as above %module(moduleimport="import $module") foo Issue https://github.com/swig/swig/issues/769
14 lines
280 B
OpenEdge ABL
14 lines
280 B
OpenEdge ABL
%define MODULEIMPORT
|
|
"
|
|
#print 'Loading low-level module $module'
|
|
import $module
|
|
#print 'Module has loaded'
|
|
extra_import_variable = 'custom import of $module'
|
|
"
|
|
%enddef
|
|
|
|
%module(moduleimport=MODULEIMPORT) python_moduleimport
|
|
|
|
%inline %{
|
|
int simple_function(int i) { return i; }
|
|
%}
|