mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Use the pipe worker instead of the debug executable for the splash screen
This commit is contained in:
parent
f4d638bf4c
commit
8a575ef753
@ -13,7 +13,7 @@ from functools import partial
|
||||
|
||||
from PyQt5.Qt import QApplication, QSplashScreen, pyqtSignal, QBrush, QColor, Qt, QPixmap
|
||||
|
||||
from calibre.constants import iswindows, isosx
|
||||
from calibre.constants import isosx, DEBUG
|
||||
from calibre.utils.ipc import eintr_retry_call
|
||||
|
||||
class SplashScreen(Thread):
|
||||
@ -36,13 +36,12 @@ class SplashScreen(Thread):
|
||||
self.hide = partial(self._rpc, 'hide')
|
||||
|
||||
def launch_process(self, debug_executable):
|
||||
kwargs = {'stdin':subprocess.PIPE}
|
||||
if iswindows:
|
||||
import win32process
|
||||
kwargs['creationflags'] = win32process.CREATE_NO_WINDOW
|
||||
kwargs['stdout'] = open(os.devnull, 'wb')
|
||||
kwargs['stderr'] = subprocess.STDOUT
|
||||
self.process = subprocess.Popen([debug_executable, '-c', 'from calibre.gui2.splash import main; main()'], **kwargs)
|
||||
from calibre.utils.ipc.simple_worker import start_pipe_worker
|
||||
if DEBUG:
|
||||
args = {'stdout':None, 'stderr': None}
|
||||
else:
|
||||
args = {'stdout':open(os.devnull, 'wb'), 'stderr':subprocess.STDOUT}
|
||||
self.process = start_pipe_worker('from calibre.gui2.splash import main; main()', **args)
|
||||
|
||||
def _rpc(self, name, *args):
|
||||
self.queue.put(('_' + name, args))
|
||||
|
Loading…
x
Reference in New Issue
Block a user