Skip to content

Commit

Permalink
BUG: Fixes loading of python bundled with an extension
Browse files Browse the repository at this point in the history
  • Loading branch information
Christopher Mullins committed Aug 17, 2012
1 parent db590b5 commit 449fe22
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Base/QTCore/qSlicerCorePythonManager.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

// Qt includes
#include <QBitArray>
#include <QSettings>

// CTK includes
#include <ctkVTKPythonQtWrapperFactory.h>
Expand Down Expand Up @@ -63,6 +64,16 @@ QStringList qSlicerCorePythonManager::pythonPaths()
paths << app->slicerHome() + "/" Slicer_BIN_DIR "/" + app->intDir();
paths << app->slicerHome() + "/" Slicer_BIN_DIR "/Python";

QSettings* settings = app->settings();
QStringList extraPaths = settings->value("Modules/AdditionalPaths").toStringList();
QStringList newPythonModulePaths;
foreach (const QString& s, extraPaths)
{
QString pythonDir = s;
pythonDir.append("/Python");
newPythonModulePaths << s;
newPythonModulePaths << pythonDir;
}
paths << app->slicerHome() + "/" Slicer_LIB_DIR;

#ifdef Slicer_BUILD_QTLOADABLEMODULES
Expand Down Expand Up @@ -121,6 +132,7 @@ QStringList qSlicerCorePythonManager::pythonPaths()
paths << app->slicerHome() + "/lib/Python" + pythonLibSubDirectory + "/site-packages";
}

paths << newPythonModulePaths;
return paths;
}

Expand Down

0 comments on commit 449fe22

Please sign in to comment.