logic: make python environment path configurable in project settings

This commit is contained in:
mlangkabel
2019-04-08 13:09:52 +02:00
parent 045a3a4e50
commit f7d3275e89
8 changed files with 126 additions and 12 deletions
@@ -36,13 +36,23 @@ std::set<FilePath> SourceGroupPythonEmpty::getAllSourceFilePaths() const
std::vector<std::shared_ptr<IndexerCommand>> SourceGroupPythonEmpty::getIndexerCommands(const std::set<FilePath>& filesToIndex) const
{
std::wstring args = L"";
args += L" --source-file-path=%{SOURCE_FILE_PATH}";
args += L" --database-file-path=%{DATABASE_FILE_PATH}";
if (!m_settings->getEnvironmentDirectoryPath().empty())
{
args += L" --environment-directory-path=" + m_settings->getEnvironmentDirectoryPathExpandedAndAbsolute().wstr();
}
std::vector<std::shared_ptr<IndexerCommand>> indexerCommands;
for (const FilePath& sourceFilePath : getAllSourceFilePaths())
{
if (filesToIndex.find(sourceFilePath) != filesToIndex.end())
{
indexerCommands.push_back(std::make_shared<IndexerCommandCustom>(
L"\"" + ResourcePaths::getPythonPath().wstr() + L"SourcetrailPythonIndexer\" --source-file-path=%{SOURCE_FILE_PATH} --database-file-path=%{DATABASE_FILE_PATH}",
L"\"" + ResourcePaths::getPythonPath().wstr() + L"SourcetrailPythonIndexer\"" + args,
m_settings->getProjectSettings()->getProjectFilePath(),
m_settings->getProjectSettings()->getTempDBFilePath(),
std::to_wstring(SqliteIndexStorage::getStorageVersion()),