mirror of
https://github.com/AleziaKurdis/overte.git
synced 2025-04-13 06:42:42 +02:00
Use environment variable for Python path.
This commit is contained in:
parent
b72d94e56d
commit
ad0a1c289d
2 changed files with 17 additions and 1 deletions
|
@ -283,7 +283,7 @@ void TestRailInterface::createAddTestCasesPythonScript(const QString& testDirect
|
|||
file.close();
|
||||
|
||||
if (QMessageBox::Yes == QMessageBox(QMessageBox::Information, "Python script has been created", "Do you want to run the script and update TestRail?", QMessageBox::Yes | QMessageBox::No).exec()) {
|
||||
QString command("C:\\Python37\\python");
|
||||
QString command(_pythonPath + "/" + pythonExe);
|
||||
QStringList parameters = QStringList() << outputDirectory + "/addTestCases.py";
|
||||
QProcess* process = new QProcess();
|
||||
connect(
|
||||
|
@ -309,6 +309,18 @@ void TestRailInterface::createTestSuitePython(const QString& testDirectory,
|
|||
const QString& userGitHub,
|
||||
const QString& branchGitHub) {
|
||||
|
||||
// First check that Python is available
|
||||
QProcessEnvironment e = QProcessEnvironment::systemEnvironment();
|
||||
QStringList sl = e.toStringList();
|
||||
if (QProcessEnvironment::systemEnvironment().contains("PYTHON_PATH")) {
|
||||
_pythonPath = QProcessEnvironment::systemEnvironment().value("PYTHON_PATH");
|
||||
if (!QFile::exists(_pythonPath + "/" + pythonExe)) {
|
||||
QMessageBox::critical(0, pythonExe, QString("Python executable not found in ") + _pythonPath);
|
||||
}
|
||||
} else {
|
||||
QMessageBox::critical(0, "PYTHON_PATH not defined", "Please set PYTHON_PATH to directory containing the Python executable");
|
||||
}
|
||||
|
||||
createTestRailDotPyScript(outputDirectory);
|
||||
createStackDotPyScript(outputDirectory);
|
||||
requestDataFromUser();
|
||||
|
|
|
@ -75,6 +75,10 @@ private:
|
|||
QString _user;
|
||||
QString _password;
|
||||
QString _project;
|
||||
|
||||
QString _pythonPath;
|
||||
|
||||
const QString pythonExe{ "python.exe" };
|
||||
};
|
||||
|
||||
#endif
|
Loading…
Reference in a new issue