| 116 | } |
| 117 | |
| 118 | RunCommandInfo PythonGenerator::getRunArguments(const ProjectInfo &projectInfo, const QString ¤tFile) |
| 119 | { |
| 120 | bool isRunCurrentFile = projectInfo.currentProgram() == exeCurrent; |
| 121 | |
| 122 | RunCommandInfo runCommandInfo; |
| 123 | |
| 124 | auto programOfProject = ConfigUtil::instance()->getConfigureParamPointer()->pythonVersion.path; |
| 125 | if(programOfProject.isEmpty()) // if this project has not set interpret of project. use default set |
| 126 | runCommandInfo.program = OptionManager::getInstance()->getPythonToolPath(); |
| 127 | else |
| 128 | runCommandInfo.program = programOfProject; |
| 129 | |
| 130 | // TODO(Mozart): program got failed, use default version. |
| 131 | if (runCommandInfo.program.isEmpty()) { |
| 132 | runCommandInfo.program = "python"; |
| 133 | } |
| 134 | runCommandInfo.workingDir = projectInfo.workspaceFolder(); |
| 135 | // get run file path. |
| 136 | QString runFilePath = currentFile; |
| 137 | if (!isRunCurrentFile) { |
| 138 | QString entryFilePath = getEntryFilePath(projectInfo.workspaceFolder()); |
| 139 | if (!entryFilePath.isEmpty()) { |
| 140 | runFilePath = entryFilePath; |
| 141 | } |
| 142 | } |
| 143 | runCommandInfo.arguments << "-u" << runFilePath; // -u : Process the output immediately without caching. |
| 144 | runCommandInfo.runInTerminal = ConfigUtil::instance()->getConfigureParamPointer()->runInTerminal; |
| 145 | |
| 146 | return runCommandInfo; |
| 147 | } |
nothing calls this directly
no test coverage detected