From 28e28b620b6a174d17651cee1e1d8b0a8521fb95 Mon Sep 17 00:00:00 2001 From: jiangweidong Date: Mon, 20 Feb 2023 22:10:59 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96DBeaver=E8=BF=9E?= =?UTF-8?q?=E6=8E=A5=E6=95=B0=E6=8D=AE=E5=BA=93=E6=97=B6=EF=BC=8C=E4=B8=8D?= =?UTF-8?q?=E6=98=BE=E7=A4=BAcli-dos=E7=AA=97=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/terminal/applets/dbeaver/app.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/apps/terminal/applets/dbeaver/app.py b/apps/terminal/applets/dbeaver/app.py index e9a7dff4d..3b058eabd 100644 --- a/apps/terminal/applets/dbeaver/app.py +++ b/apps/terminal/applets/dbeaver/app.py @@ -2,8 +2,7 @@ import os import time import win32api import shutil - -from pywinauto import Application +import subprocess from common import wait_pid, BaseApplication @@ -61,16 +60,18 @@ class AppletApplication(BaseApplication): def run(self): self.launch() - self.app = Application(backend='uia') function = getattr(self, '_get_%s_exec_params' % self.protocol, None) if function is None: params = self._get_exec_params() else: params = function() - exec_string = '%s -con %s' % (self.path, params) - self.app.start(exec_string, wait_for_idle=False) - self.pid = self.app.process + + startupinfo = subprocess.STARTUPINFO() + startupinfo.dwFlags = subprocess.CREATE_NEW_CONSOLE | subprocess.STARTF_USESHOWWINDOW + startupinfo.wShowWindow = subprocess.SW_HIDE + ret = subprocess.Popen([self.path, '-con', params], startupinfo=startupinfo) + self.pid = ret.pid def wait(self): wait_pid(self.pid)