eric6/Utilities/BackgroundService.py

branch
maintenance
changeset 8400
b3eefd7e58d1
parent 8273
698ae46f40a4
parent 8309
10aa9235b817
child 8576
fe1957c69854
equal deleted inserted replaced
8274:197414ba11cc 8400:b3eefd7e58d1
21 21
22 from E5Gui import E5MessageBox 22 from E5Gui import E5MessageBox
23 from E5Gui.E5Application import e5App 23 from E5Gui.E5Application import e5App
24 import Preferences 24 import Preferences
25 import Utilities 25 import Utilities
26 26 import Globals
27 from eric6config import getConfig
28 27
29 28
30 class BackgroundService(QTcpServer): 29 class BackgroundService(QTcpServer):
31 """ 30 """
32 Class implementing the main part of the background service. 31 Class implementing the main part of the background service.
92 """ 91 """
93 if interpreter == "" or not Utilities.isinpath(interpreter): 92 if interpreter == "" or not Utilities.isinpath(interpreter):
94 return None 93 return None
95 94
96 backgroundClient = os.path.join( 95 backgroundClient = os.path.join(
97 getConfig('ericDir'), 96 os.path.dirname(__file__), "BackgroundClient.py")
98 "Utilities", "BackgroundClient.py")
99 proc = QProcess() 97 proc = QProcess()
100 proc.setProcessChannelMode( 98 proc.setProcessChannelMode(
101 QProcess.ProcessChannelMode.ForwardedChannels) 99 QProcess.ProcessChannelMode.ForwardedChannels)
102 args = [backgroundClient, self.hostAddress, str(port), 100 args = [
103 str(Preferences.getUI("BackgroundServiceProcesses"))] 101 backgroundClient,
102 self.hostAddress,
103 str(port),
104 str(Preferences.getUI("BackgroundServiceProcesses")),
105 Globals.getPythonLibraryDirectory(),
106 ]
104 proc.start(interpreter, args) 107 proc.start(interpreter, args)
105 if not proc.waitForStarted(10000): 108 if not proc.waitForStarted(10000):
106 proc = None 109 proc = None
107 return proc 110 return proc
108 111

eric ide

mercurial