221 self.__socket.readUntil(b">>> ", timeout=timeout) |
221 self.__socket.readUntil(b">>> ", timeout=timeout) |
222 .replace(b">>> ", b"") |
222 .replace(b">>> ", b"") |
223 .strip() |
223 .strip() |
224 ) |
224 ) |
225 if self.__socket.hasTimedOut(): |
225 if self.__socket.hasTimedOut(): |
226 self.__blockReadyRead = False |
226 out, err = b"", b"Timeout while processing commands." |
227 return b"", b"Timeout while processing commands." |
|
228 |
|
229 # get rid of any OSD string and send it |
|
230 if result.startswith(b"\x1b]0;"): |
|
231 osd, result = result.split(b"\x1b\\", 1) |
|
232 self.osdInfo.emit(osd[4:].decode("utf-8")) |
|
233 |
|
234 if self.TracebackMarker in result: |
|
235 errorIndex = result.find(self.TracebackMarker) |
|
236 out, err = result[:errorIndex], result[errorIndex:].replace(">>> ", "") |
|
237 else: |
227 else: |
238 out = result |
228 # get rid of any OSD string and send it |
239 err = b"" |
229 if result.startswith(b"\x1b]0;"): |
|
230 osd, result = result.split(b"\x1b\\", 1) |
|
231 self.osdInfo.emit(osd[4:].decode("utf-8")) |
|
232 |
|
233 if self.TracebackMarker in result: |
|
234 errorIndex = result.find(self.TracebackMarker) |
|
235 out, err = result[:errorIndex], result[errorIndex:].replace(">>> ", "") |
|
236 else: |
|
237 out = result |
|
238 err = b"" |
240 |
239 |
241 self.__blockReadyRead = False |
240 self.__blockReadyRead = False |
242 return out, err |
241 return out, err |
243 |
242 |
244 def executeAsync(self, commandsList, submitMode): |
243 def executeAsync(self, commandsList, submitMode): |