2
0
forked from awendt/pyrelacs

[app] starting repos with as a thread

This commit is contained in:
wendtalexander
2024-09-27 10:21:05 +02:00
parent cb5c08bc94
commit cd6bc0dc04
3 changed files with 47 additions and 12 deletions

View File

@@ -93,6 +93,21 @@ class PyRelacs(QMainWindow):
def run_repro(self, n, fn):
self.text.appendPlainText(f"started Repro {n}, {fn}")
worker = Worker(self.repros.run_repro, n, fn)
worker.signals.result.connect(self.print_output)
worker.signals.finished.connect(self.thread_complete)
worker.signals.progress.connect(self.progress_fn)
self.threadpool.start(worker)
def print_output(self, s):
print(s)
def thread_complete(self):
print("THREAD COMPLETE!")
def progress_fn(self, n):
print("%d%% done" % n)
def main():
@@ -114,7 +129,7 @@ def main():
window.resize(width, height)
window.move(x, y)
window.show()
app.exec()
exit_code = app.exec()
# store window position and size
pos = window.pos()
@@ -126,4 +141,5 @@ def main():
if __name__ == "__main__":
main()
main()