summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancois Andriot <francois.andriot@free.fr>2014-01-18 16:49:42 +0100
committerSlávek Banko <slavek.banko@axis.cz>2014-01-18 16:49:42 +0100
commitf664d2c45fbb060dfbf2fcd7f2f0cabbf7427954 (patch)
tree6c06d293724bd4b2fa54a80c48fbdc9c05746b6e
parent7f3ecf70d4f032e7d43d8d98a4a10a4013cbea5f (diff)
downloadpytdeextensions-f664d2c45fbb060dfbf2fcd7f2f0cabbf7427954.tar.gz
pytdeextensions-f664d2c45fbb060dfbf2fcd7f2f0cabbf7427954.zip
Adds the EXTRA_MODULES_DIR variable
-rw-r--r--src/kdedistutils.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/kdedistutils.py b/src/kdedistutils.py
index 83c492b..7e77d09 100644
--- a/src/kdedistutils.py
+++ b/src/kdedistutils.py
@@ -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 ());