mirror of
https://github.com/OPM/ResInsight.git
synced 2026-09-03 20:53:13 -05:00
Python: add extra path to PythonPath for Linux
This commit is contained in:
@@ -95,6 +95,8 @@
|
|||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#else
|
#else
|
||||||
@@ -950,15 +952,18 @@ QProcessEnvironment RiaApplication::pythonProcessEnvironment() const
|
|||||||
penv.insert("RESINSIGHT_EXECUTABLE", QCoreApplication::applicationFilePath());
|
penv.insert("RESINSIGHT_EXECUTABLE", QCoreApplication::applicationFilePath());
|
||||||
|
|
||||||
QStringList ripsLocations;
|
QStringList ripsLocations;
|
||||||
|
QString separator;
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
ripsLocations << QCoreApplication::applicationDirPath() + "\\Python"
|
ripsLocations << QCoreApplication::applicationDirPath() + "\\Python"
|
||||||
<< QCoreApplication::applicationDirPath() + "\\..\\..\\Python";
|
<< QCoreApplication::applicationDirPath() + "\\..\\..\\Python";
|
||||||
|
separator = ";";
|
||||||
|
|
||||||
#else
|
#else
|
||||||
ripsLocations << QCoreApplication::applicationDirPath() + "/Python";
|
ripsLocations << QCoreApplication::applicationDirPath() + "/Python"
|
||||||
|
<< QCoreApplication::applicationDirPath() + "/../../Python";
|
||||||
|
separator = ":";
|
||||||
#endif
|
#endif
|
||||||
|
penv.insert("PYTHONPATH", QString("%1%2%3").arg(penv.value("PYTHONPATH")).arg(separator).arg(ripsLocations.join(separator)));
|
||||||
penv.insert("PYTHONPATH", QString("%1;%2").arg(penv.value("PYTHONPATH")).arg(ripsLocations.join(";")));
|
|
||||||
#endif
|
#endif
|
||||||
return penv;
|
return penv;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user