|
|
|
@ -755,6 +755,7 @@ class BuildKControlModule(Command):
|
|
|
|
|
|
|
|
|
|
# Build the 'stub' code.
|
|
|
|
|
cppcode = self.cpptemplate % {"moduledir": self.data_dir,
|
|
|
|
|
"extramodule": os.getenv("EXTRA_MODULE_DIR"),
|
|
|
|
|
"modulename": modulename,
|
|
|
|
|
"factoryfunction": factoryfunction,
|
|
|
|
|
"python_version": python_version}
|
|
|
|
@ -898,6 +899,7 @@ class BuildKControlModule(Command):
|
|
|
|
|
#include <sip.h>
|
|
|
|
|
|
|
|
|
|
#define MODULE_DIR "%(moduledir)s"
|
|
|
|
|
#define EXTRA_MODULE_DIR "%(extramodule)s"
|
|
|
|
|
#define MODULE_NAME "%(modulename)s"
|
|
|
|
|
#define FACTORY "%(factoryfunction)s"
|
|
|
|
|
#define CPP_FACTORY %(factoryfunction)s
|
|
|
|
@ -938,6 +940,12 @@ static TDECModule* return_instance( TQWidget *parent, const char *name ) {
|
|
|
|
|
if(!pyize->appendToSysPath (path.latin1 ())) {
|
|
|
|
|
return report_error ("***Failed to set sys.path\n");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Add the extra path to the python script to the interpreter search path.
|
|
|
|
|
TQString extrapath = TQString(EXTRA_MODULE_DIR);
|
|
|
|
|
if(!pyize->appendToSysPath (extrapath.latin1 ())) {
|
|
|
|
|
return report_error ("***Failed to set extra sys.path\n");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Load the Python script.
|
|
|
|
|
PyObject *pyModule = pyize->importModule ((char *)script.latin1 ());
|
|
|
|
|