forked from awendt/pyrelacs
[app] starting repos with as a thread
This commit is contained in:
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user