Skip to content

Commit

Permalink
Python support: update the PATH using \ rather than / on Windows (c…
Browse files Browse the repository at this point in the history
…loses #2219).
  • Loading branch information
agarny committed Nov 21, 2019
2 parents 4048a36 + 6a34f01 commit 8d3fe9f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
1 change: 1 addition & 0 deletions doc/downloads/index.js
Expand Up @@ -38,6 +38,7 @@ var jsonData = { "versions": [
],
"changes": [
{ "change": "<strong>General:</strong> added (initial) support for <a href=\"https://www.python.org/\">Python</a> (see issue <a href=\"https://github.com/opencor/opencor/issues/1255\">#1255</a>)." },
{ "change": "<strong>Python support:</strong> update the PATH using <code>\\</code> rather than <code>/</code> on Windows (see issue <a href=\"https://github.com/opencor/opencor/issues/2219\">#2219</a>)." },
{ "change": "<strong>SED-ML support:</strong> added support left and right triangle symbols (see issue <a href=\"https://github.com/opencor/opencor/issues/2173\">#2173</a>)." },
{ "change": "<strong>Simulation Experiment view:</strong> properly handle the Graph Panel properties (see issue <a href=\"https://github.com/opencor/opencor/issues/2171\">#2171</a>). Make sure that curves are plotted with all of their original settings when reloading a SED-ML file (see issue <a href=\"https://github.com/opencor/opencor/issues/2176\">#2176</a>). Make sure that all of a solver's properties get saved to a SED-ML file (see issue <a href=\"https://github.com/opencor/opencor/issues/2185\">#2185</a>)." },
{ "change": "<strong>Third-party libraries:</strong> upgraded the <a href=\"https://www.openssl.org/\">OpenSSL</a> library to version 1.1.1d (see issue <a href=\"https://github.com/opencor/opencor/issues/2157\">#2157</a>). Upgraded <a href=\"http://www.llvm.org/\">LLVM</a>+<a href=\"http://clang.llvm.org/\">Clang</a> to version 9.0.0 (see issue <a href=\"https://github.com/opencor/opencor/issues/2161\">#2161</a>). Upgraded <a href=\"https://www.mesa3d.org/\">Mesa</a> to version 19.2.1 (see issue <a href=\"https://github.com/opencor/opencor/issues/2197\">#2197</a>). Upgraded the <a href=\"http://computation.llnl.gov/projects/sundials\">SUNDIALS</a> library to version 5.0.0 (see issue <a href=\"https://github.com/opencor/opencor/issues/2198\">#2198</a>). Upgraded <a href=\"https://riverbankcomputing.com/software/qscintilla/intro\">QScintilla</a> to version 2.11.3 (see issue <a href=\"https://github.com/opencor/opencor/issues/2208\">#2208</a>)." }
Expand Down
10 changes: 4 additions & 6 deletions src/plugins/support/PythonSupport/src/pythonsupportplugin.cpp
Expand Up @@ -26,9 +26,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
//==============================================================================

#include <QCoreApplication>
#if defined(Q_OS_WIN) || defined(Q_OS_LINUX)
#include <QDir>
#endif
#include <QDir>

//==============================================================================

Expand Down Expand Up @@ -119,7 +117,7 @@ void PythonSupportPlugin::initializePlugin()
}
#endif

qputenv("PYTHONHOME", pythonHome.toUtf8());
qputenv("PYTHONHOME", QDir::toNativeSeparators(pythonHome).toUtf8());

// Update our system PATH by prepending our Python script directories to it

Expand All @@ -129,13 +127,13 @@ void PythonSupportPlugin::initializePlugin()
static const char PathSeparator = ':';
#endif

QByteArray path = (pythonHome+"/bin").toUtf8()+PathSeparator+qgetenv("PATH");
QString path = pythonHome+"/bin"+PathSeparator+qEnvironmentVariable("PATH");

#ifdef Q_OS_WIN
path = (pythonHome+"/Scripts").toUtf8()+PathSeparator+path;
#endif

qputenv("PATH", path);
qputenv("PATH", QDir::toNativeSeparators(path).toUtf8());

// Ensure that the user's Python site directory (in ~/.local, etc.) isn't
// used
Expand Down

0 comments on commit 8d3fe9f

Please sign in to comment.