--- a/tests/ide_tests/sikuliberemiz.py Fri Nov 11 16:07:38 2022 +0100
+++ b/tests/ide_tests/sikuliberemiz.py Tue Nov 15 14:03:04 2022 +0100
@@ -120,7 +120,6 @@
a = self.proc.stdout.readline()
if len(a) == 0 or a is None:
if self.pattern is not None and a.find(self.pattern) >= 0:
@@ -172,7 +171,6 @@
end_time = timesec() + timeout
remain = end_time - timesec()
@@ -319,27 +317,17 @@
def ReportOutput(self, text):
elapsed = "%.3fs: "%(timesec() - self.starttime)
+ sys.stdout.write(elapsed + text) self.report.write("<pre>" + elapsed + text + "</pre>")
+class AuxiliaryProcess(stdoutIdleObserver): def __init__(self, beremiz_app, command):
self.app.ReportText("Launching process " + repr(command))
self.proc = subprocess.Popen(command, stdout=subprocess.PIPE, bufsize=0)
self.app.ReportText("Launched process " + repr(command) + " PID: " + str(self.proc.pid))
- if self.proc is not None:
- self.thread = Thread(target = self._waitStdoutProc).start()
- def _waitStdoutProc(self):
- a = self.proc.stdout.readline()
- if len(a) == 0 or a is None:
- self.ReportOutput("AuxStdoutFinish")
+ stdoutIdleObserver.__init__(self) if self.proc is not None:
@@ -354,6 +342,12 @@
+ def ReportOutput(self, text): + self.app.ReportOutput("Aux: "+text) + def ReportScreenShot(self, msg): + self.app.ReportOutput("Aux: "+msg) @@ -367,7 +361,6 @@
# and catch exception cleanly anyhow
e_type, e_value, e_traceback = sys.exc_info()
err_msg = "\n".join(traceback.format_exception(e_type, e_value, e_traceback))
- sys.stdout.write(err_msg)
app.ReportOutput(err_msg)