eric6/Utilities/BackgroundService.py

changeset 8307
01a323d3d4d7
parent 8264
f95dde35d0ab
child 8309
10aa9235b817
equal deleted inserted replaced
8306:2bfd53096b5f 8307:01a323d3d4d7
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
29 27
30 class BackgroundService(QTcpServer): 28 class BackgroundService(QTcpServer):
31 """ 29 """
32 Class implementing the main part of the background service. 30 Class implementing the main part of the background service.
33 31
92 """ 90 """
93 if interpreter == "" or not Utilities.isinpath(interpreter): 91 if interpreter == "" or not Utilities.isinpath(interpreter):
94 return None 92 return None
95 93
96 backgroundClient = os.path.join( 94 backgroundClient = os.path.join(
97 getConfig('ericDir'), 95 os.path.dirname(__file__), "BackgroundClient.py")
98 "Utilities", "BackgroundClient.py")
99 proc = QProcess() 96 proc = QProcess()
100 proc.setProcessChannelMode( 97 proc.setProcessChannelMode(
101 QProcess.ProcessChannelMode.ForwardedChannels) 98 QProcess.ProcessChannelMode.ForwardedChannels)
102 args = [backgroundClient, self.hostAddress, str(port), 99 args = [
103 str(Preferences.getUI("BackgroundServiceProcesses"))] 100 backgroundClient,
101 self.hostAddress,
102 str(port),
103 str(Preferences.getUI("BackgroundServiceProcesses")),
104 Globals.getPythonLibraryDirectory(),
105 ]
104 proc.start(interpreter, args) 106 proc.start(interpreter, args)
105 if not proc.waitForStarted(10000): 107 if not proc.waitForStarted(10000):
106 proc = None 108 proc = None
107 return proc 109 return proc
108 110

eric ide

mercurial