eric6/DebugClients/Python/QProcessExtension.py

branch
multi_processing
changeset 7419
9c1163735448
parent 7412
0a995393d2ba
child 7424
9bb7d8b0f966
equal deleted inserted replaced
7418:6214fa980a9d 7419:9c1163735448
76 arguments = self.arguments() 76 arguments = self.arguments()
77 if len(args) == 1: 77 if len(args) == 1:
78 mode = args[0] 78 mode = args[0]
79 else: 79 else:
80 mode = module.QIODevice.ReadWrite 80 mode = module.QIODevice.ReadWrite
81 ok, (program, arguments) = isPythonProgram(program, arguments) 81 ok = isPythonProgram(program)
82 if ( 82 if (
83 ok and ( 83 ok and (
84 not os.path.basename(arguments[0]) 84 not os.path.basename(arguments[0])
85 in _debugClient.noDebugList 85 in _debugClient.noDebugList
86 ) 86 )
87 ): 87 ):
88 newArgs = patchArguments( 88 newArgs = patchArguments(
89 arguments, _debugClient.multiprocessSupport) 89 _debugClient,
90 super(QProcessWrapper, self).start(program, newArgs, mode) 90 [program] + arguments,
91 else: 91 )
92 super(QProcessWrapper, self).start(*args, **kwargs) 92 super(QProcessWrapper, self).start(
93 else: 93 newArgs[0], newArgs[1:], mode)
94 super(QProcessWrapper, self).start(*args, **kwargs) 94 return
95
96 super(QProcessWrapper, self).start(*args, **kwargs)
95 97
96 ################################################################### 98 ###################################################################
97 ## Handling of 'startDetached(...)' below 99 ## Handling of 'startDetached(...)' below
98 ################################################################### 100 ###################################################################
99 101
140 ): 142 ):
141 program = self.program() 143 program = self.program()
142 arguments = self.arguments() 144 arguments = self.arguments()
143 wd = self.workingDirectory() 145 wd = self.workingDirectory()
144 146
145 ok, (program, arguments) = isPythonProgram(program, arguments) 147 ok = isPythonProgram(program)
146 if ok: 148 if ok:
147 return QProcessWrapper.startDetachedStatic( 149 return QProcessWrapper.startDetachedStatic(
148 program, arguments, wd) 150 program, arguments, wd)
149 else: 151
150 return super(QProcessWrapper, self).startDetached( 152 return super(QProcessWrapper, self).startDetached(*args, **kwargs)
151 *args, **kwargs)
152 else:
153 return super(QProcessWrapper, self).startDetached(
154 *args, **kwargs)
155 153
156 @staticmethod 154 @staticmethod
157 def startDetachedStatic(*args, **kwargs): 155 def startDetachedStatic(*args, **kwargs):
158 """ 156 """
159 Static method to start the detached process. 157 Static method to start the detached process.
178 arguments = args[1] 176 arguments = args[1]
179 if len(args) >= 3: 177 if len(args) >= 3:
180 wd = args[2] 178 wd = args[2]
181 else: 179 else:
182 wd = "" 180 wd = ""
183 ok, (program, arguments) = isPythonProgram(program, arguments) 181 ok = isPythonProgram(program)
184 if ok: 182 if ok:
185 newArgs = patchArguments( 183 newArgs = patchArguments(
186 arguments, _debugClient.multiprocessSupport) 184 _debugClient,
185 [program] + arguments,
186 )
187 return QProcessWrapper._origQProcessStartDetached( 187 return QProcessWrapper._origQProcessStartDetached(
188 program, newArgs, wd) 188 newArgs[0], newArgs[1:], wd)
189 else: 189
190 return QProcessWrapper._origQProcessStartDetached( 190 return QProcessWrapper._origQProcessStartDetached(
191 *args, **kwargs) 191 *args, **kwargs)
192 else:
193 return QProcessWrapper._origQProcessStartDetached(
194 *args, **kwargs)
195 192
196 _debugClient = debugClient 193 _debugClient = debugClient
197 module.QProcess = QProcessWrapper 194 module.QProcess = QProcessWrapper

eric ide

mercurial