198 have the keys 'I' and 'L' and each entry must be a function receiving |
198 have the keys 'I' and 'L' and each entry must be a function receiving |
199 the number of bytes to write. |
199 the number of bytes to write. |
200 @param outputChannels dictionary of output channels. The dictionary must |
200 @param outputChannels dictionary of output channels. The dictionary must |
201 have the keys 'o' and 'e' and each entry must be a function receiving |
201 have the keys 'o' and 'e' and each entry must be a function receiving |
202 the data. |
202 the data. |
203 @return result code of the command or -10, if the command was canceled (integer) |
203 @return result code of the command, -1 if the command server wasn't started or |
|
204 -10, if the command was canceled (integer) |
204 """ |
205 """ |
205 if not self.__started: |
206 if not self.__started: |
206 return -10 |
207 return -1 |
207 |
208 |
208 self.__server.write(QByteArray(b'runcommand\n')) |
209 self.__server.write(QByteArray(b'runcommand\n')) |
209 self.__writeDataBlock('\0'.join(args)) |
210 self.__writeDataBlock('\0'.join(args)) |
210 |
211 |
211 while True: |
212 while True: |
212 QCoreApplication.processEvents() |
213 QCoreApplication.processEvents() |
213 |
214 |
214 if self.__cancel: |
215 if self.__cancel: |
215 return -1 |
216 return -10 |
216 |
217 |
217 if self.__server.bytesAvailable() == 0: |
218 if self.__server.bytesAvailable() == 0: |
218 continue |
219 continue |
219 channel, data = self.__readChannel() |
220 channel, data = self.__readChannel() |
220 |
221 |