Python: Wrap some file paths and kit name with quotes

Change-Id: If147eae864013d410239d69184cdb9a4bc4479eb
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
This commit is contained in:
Eike Ziller
2024-02-26 09:00:08 +01:00
parent 2d7af40007
commit 44f6bbf260
2 changed files with 12 additions and 8 deletions

View File

@@ -108,15 +108,17 @@ public:
result << BuildSystemTask(Task::Error, Tr::tr("No Python setup."));
} else if (!path.exists()) {
result << BuildSystemTask(Task::Error,
Tr::tr("Python %1 not found.").arg(path.toUserOutput()));
Tr::tr("Python \"%1\" not found.").arg(path.toUserOutput()));
} else if (!path.isExecutableFile()) {
result << BuildSystemTask(Task::Error,
Tr::tr("Python %1 not executable.").arg(path.toUserOutput()));
Tr::tr("Python \"%1\" is not executable.")
.arg(path.toUserOutput()));
} else {
if (!pipIsUsable(path)) {
result << BuildSystemTask(
Task::Warning,
Tr::tr("Python %1 does not contain a usable pip. Pip is used to install python "
Tr::tr("Python \"%1\" does not contain a usable pip. Pip is used to install "
"python "
"packages from the Python Package Index, like PySide and the python "
"language server. If you want to use any of that functionality "
"ensure pip is installed for that python.")
@@ -125,7 +127,8 @@ public:
if (!venvIsUsable(path)) {
result << BuildSystemTask(
Task::Warning,
Tr::tr("Python %1 does not contain a usable venv. venv is the recommended way "
Tr::tr(
"Python \"%1\" does not contain a usable venv. venv is the recommended way "
"to isolate a development environment for a project from the globally "
"installed python.")
.arg(path.toUserOutput()));

View File

@@ -33,8 +33,9 @@ Tasks PythonProject::projectIssues(const Kit *k) const
{
if (PythonKitAspect::python(k))
return {};
return {BuildSystemTask{Task::Error,
Tr::tr("No python interpreter set for kit %1").arg(k->displayName())}};
return {
BuildSystemTask{Task::Error,
Tr::tr("No python interpreter set for kit \"%1\"").arg(k->displayName())}};
}
PythonProjectNode::PythonProjectNode(const FilePath &path)