Allow multiple Python Path elements to be given in a semi-colon delimited list.

This commit is contained in:
Dave Page 2016-01-12 13:50:49 +00:00
parent 185ac442fc
commit 2354c3e07d

View File

@ -37,8 +37,15 @@ Server::Server(quint16 port)
if (python_path.length() > 0) if (python_path.length() > 0)
{ {
// Split the path setting into individual entries
QStringList path_list = python_path.split(";", QString::SkipEmptyParts);
// Get the current path
PyObject* sysPath = PySys_GetObject((char*)"path"); PyObject* sysPath = PySys_GetObject((char*)"path");
PyList_Append(sysPath, PyString_FromString(python_path.toUtf8().data()));
// Add new additional path elements
for (int i = 0; i < path_list.size(); ++i)
PyList_Append(sysPath, PyString_FromString(path_list.at(i).toUtf8().data()));
} }
} }