From 02e863680e945c4d514cc6aa7142507e00c7b190 Mon Sep 17 00:00:00 2001 From: Andrey Vokin Date: Mon, 25 Sep 2023 12:38:05 +0200 Subject: [PATCH] DS-5308: improve dbt init experience GitOrigin-RevId: 43d346752cedb9d19c6bc3080f1a13c9eaf3abdf --- .../src/com/jetbrains/python/sdk/PySdkUtil.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/python/python-sdk/src/com/jetbrains/python/sdk/PySdkUtil.java b/python/python-sdk/src/com/jetbrains/python/sdk/PySdkUtil.java index 436dd96f96c5..6e346d960087 100644 --- a/python/python-sdk/src/com/jetbrains/python/sdk/PySdkUtil.java +++ b/python/python-sdk/src/com/jetbrains/python/sdk/PySdkUtil.java @@ -26,6 +26,7 @@ import com.jetbrains.python.psi.impl.PyBuiltinCache; import com.jetbrains.python.run.CommandLinePatcher; import com.jetbrains.python.run.PyVirtualEnvReader; import com.jetbrains.python.sdk.flavors.PythonSdkFlavor; +import org.jetbrains.annotations.Nls; import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -112,6 +113,14 @@ public final class PySdkUtil { @Nullable @NonNls Map extraEnv, int timeout, byte @Nullable [] stdin, boolean needEOFMarker) { + return getProcessOutput(cmd, homePath, extraEnv, timeout, stdin, needEOFMarker, null); + } + + public static ProcessOutput getProcessOutput(@NotNull GeneralCommandLine cmd, @Nullable String homePath, + @Nullable @NonNls Map extraEnv, + int timeout, + byte @Nullable [] stdin, boolean needEOFMarker, + @Nullable @Nls(capitalization = Nls.Capitalization.Title) String customTitle) { if (homePath == null || !new File(homePath).exists()) { return new ProcessOutput(); } @@ -149,8 +158,8 @@ public final class PySdkUtil { assert application.isUnitTestMode() || application.isHeadlessEnvironment() || !application.isWriteAccessAllowed() : "Background task can't be run under write action"; - return progressManager.runProcessWithProgressSynchronously(() -> processHandler.runProcess(timeout), - PySdkBundle.message("python.sdk.run.wait"), false, null); + String dialogTitle = customTitle != null ? customTitle : PySdkBundle.message("python.sdk.run.wait"); + return progressManager.runProcessWithProgressSynchronously(() -> processHandler.runProcess(timeout), dialogTitle , false, null); } else { return processHandler.runProcess();