37 a batch job (str, str) |
37 a batch job (str, str) |
38 """ |
38 """ |
39 serviceNotAvailable = pyqtSignal(str, str, str, str) |
39 serviceNotAvailable = pyqtSignal(str, str, str, str) |
40 batchJobDone = pyqtSignal(str, str) |
40 batchJobDone = pyqtSignal(str, str) |
41 |
41 |
42 def __init__(self): |
42 def __init__(self, parent=None): |
43 """ |
43 """ |
44 Constructor |
44 Constructor |
|
45 |
|
46 @param parent reference to the parent object |
|
47 @type QObject |
45 """ |
48 """ |
46 self.processes = {} |
49 self.processes = {} |
47 self.connections = {} |
50 self.connections = {} |
48 self.isWorking = None |
51 self.isWorking = None |
49 self.runningJob = [None, None, None, None] |
52 self.runningJob = [None, None, None, None] |
50 self.__queue = [] |
53 self.__queue = [] |
51 self.services = {} |
54 self.services = {} |
52 |
55 |
53 super(BackgroundService, self).__init__() |
56 super(BackgroundService, self).__init__(parent) |
54 |
57 |
55 networkInterface = Preferences.getDebugger("NetworkInterface") |
58 networkInterface = Preferences.getDebugger("NetworkInterface") |
56 if networkInterface == "all" or '.' in networkInterface: |
59 if networkInterface == "all" or '.' in networkInterface: |
57 self.hostAddress = '127.0.0.1' |
60 self.hostAddress = '127.0.0.1' |
58 else: |
61 else: |
91 |
94 |
92 backgroundClient = os.path.join( |
95 backgroundClient = os.path.join( |
93 getConfig('ericDir'), |
96 getConfig('ericDir'), |
94 "Utilities", "BackgroundClient.py") |
97 "Utilities", "BackgroundClient.py") |
95 proc = QProcess() |
98 proc = QProcess() |
96 proc.setProcessChannelMode(QProcess.ForwardedChannels) |
99 proc.setProcessChannelMode( |
|
100 QProcess.ProcessChannelMode.ForwardedChannels) |
97 args = [backgroundClient, self.hostAddress, str(port), |
101 args = [backgroundClient, self.hostAddress, str(port), |
98 str(Preferences.getUI("BackgroundServiceProcesses"))] |
102 str(Preferences.getUI("BackgroundServiceProcesses"))] |
99 proc.start(interpreter, args) |
103 proc.start(interpreter, args) |
100 if not proc.waitForStarted(10000): |
104 if not proc.waitForStarted(10000): |
101 proc = None |
105 proc = None |