From 95b312f00ee70faba69d58d6858a00cbb9de7f4b Mon Sep 17 00:00:00 2001 From: Vitaly Legchilkin Date: Mon, 4 Dec 2023 15:50:28 +0100 Subject: [PATCH] Align python download and install progress text/details with a guideline (PY-64420) Previous texts were uninformative and didn't comply with our guidelines. GitOrigin-RevId: ec9f3b6456e504a806c94ff9427f147085be668d --- .../python-sdk/resources/messages/PySdkBundle.properties | 9 ++++----- .../jetbrains/python/sdk/installer/ReleaseInstaller.kt | 9 ++------- .../python/sdk/installer/ResourceTypeReleaseInstaller.kt | 5 +++-- 3 files changed, 9 insertions(+), 14 deletions(-) diff --git a/python/python-sdk/resources/messages/PySdkBundle.properties b/python/python-sdk/resources/messages/PySdkBundle.properties index 072cead200a9..d19f2394eae1 100644 --- a/python/python-sdk/resources/messages/PySdkBundle.properties +++ b/python/python-sdk/resources/messages/PySdkBundle.properties @@ -35,11 +35,10 @@ python.sdk.please.reconfigure.interpreter=Please reconfigure Python interpreter python.sdk.pipenv.creating.venv.not.supported=Creating a virtual environments based on Pipenv environments is not supported python.sdk.invalid.remote.sdk=Invalid remote SDK python.sdk.package.managing.not.supported.for.sdk=Package managing is not supported for SDK {0} -python.sdk.preparation.hint=Preparing for installation -python.sdk.downloading=Downloading {0} -python.sdk.installing.hint.windows=Windows may require your approval. Please check the taskbar. -python.sdk.installing.hint=Installation is in progress. Please check system alerts. -python.sdk.running=Running {0} +python.sdk.preparation.progress.text=Preparing for installation\u2026 +python.sdk.downloading.progress.details=Downloading {0} +python.sdk.running.progress.text=Running {0}\u2026 +python.sdk.running.one.minute.progress.details=About 1 minute left python.sdk.running.sudo.prompt=Enter your password to install {0} # PLEASE add only the keys that are supposed to be re-used by plugins, diff --git a/python/python-sdk/src/com/jetbrains/python/sdk/installer/ReleaseInstaller.kt b/python/python-sdk/src/com/jetbrains/python/sdk/installer/ReleaseInstaller.kt index b9107138df00..8f91bbcc70dc 100644 --- a/python/python-sdk/src/com/jetbrains/python/sdk/installer/ReleaseInstaller.kt +++ b/python/python-sdk/src/com/jetbrains/python/sdk/installer/ReleaseInstaller.kt @@ -9,7 +9,6 @@ import com.intellij.openapi.progress.ProcessCanceledException import com.intellij.openapi.progress.ProgressIndicator import com.intellij.openapi.util.io.FileUtil import com.intellij.util.io.HttpRequests -import com.intellij.util.system.OS import com.jetbrains.python.PySdkBundle import com.jetbrains.python.sdk.* import java.nio.file.Path @@ -79,17 +78,13 @@ abstract class DownloadableReleaseInstaller : ReleaseInstaller { Paths.get(tempPath, "${System.nanoTime()}-${it.fileName}") } try { - indicator.text = PySdkBundle.message("python.sdk.preparation.hint") + indicator.text = PySdkBundle.message("python.sdk.preparation.progress.text") files.forEach { (resource, path) -> download(resource, path, indicator) } onPrepareComplete() - indicator.text = when(OS.CURRENT) { - OS.Windows -> PySdkBundle.message("python.sdk.installing.hint.windows") - else -> PySdkBundle.message("python.sdk.installing.hint") - } process(release, files, indicator) } finally { @@ -115,7 +110,7 @@ abstract class DownloadableReleaseInstaller : ReleaseInstaller { @Throws(PrepareException::class) private fun download(resource: Resource, target: Path, indicator: ProgressIndicator) { LOGGER.info("Downloading ${resource.url} to $target") - indicator.text2 = PySdkBundle.message("python.sdk.downloading", resource.fileName) + indicator.text2 = PySdkBundle.message("python.sdk.downloading.progress.details", resource.fileName) try { indicator.checkCanceled() HttpRequests.request(resource.url) diff --git a/python/python-sdk/src/com/jetbrains/python/sdk/installer/ResourceTypeReleaseInstaller.kt b/python/python-sdk/src/com/jetbrains/python/sdk/installer/ResourceTypeReleaseInstaller.kt index b5f2a56a5baa..0106cbe0130e 100644 --- a/python/python-sdk/src/com/jetbrains/python/sdk/installer/ResourceTypeReleaseInstaller.kt +++ b/python/python-sdk/src/com/jetbrains/python/sdk/installer/ResourceTypeReleaseInstaller.kt @@ -42,7 +42,6 @@ abstract class ResourceTypeReleaseInstaller(private val resourceType: ResourceTy @Throws(ProcessException::class) override fun process(release: Release, resourcePaths: Map, indicator: ProgressIndicator) { - indicator.isIndeterminate = true resourcePaths.forEach { (resource, path) -> processResource(resource, path, indicator) } @@ -50,7 +49,9 @@ abstract class ResourceTypeReleaseInstaller(private val resourceType: ResourceTy @Throws(ProcessException::class) private fun processResource(resource: Resource, path: Path, indicator: ProgressIndicator) { - indicator.text2 = PySdkBundle.message("python.sdk.running", resource.fileName) + indicator.isIndeterminate = true + indicator.text = PySdkBundle.message("python.sdk.running.progress.text", resource.fileName) + indicator.text2 = PySdkBundle.message("python.sdk.running.one.minute.progress.details") val commandLine = buildCommandLine(resource, path) LOGGER.info("Running ${commandLine.commandLineString}")