st-ten-1/src/ui/test_fail/test_fail.py

35 lines
1.1 KiB
Python
Raw Normal View History

2022-09-20 15:42:59 +00:00
import re
import sys
import weakref
from lib.helpers import timing
from PyQt5.QtCore import QTimer
from PyQt5.QtGui import QKeySequence
from PyQt5.QtWidgets import QShortcut
from ui.test_test import Test_Test
class Test_Fail(Test_Test):
def __init__(self, components=None, recipe=None, step=None, run_once=False, enable_override=False):
super().__init__(components=components, recipe=recipe, step=step, run_once=run_once, enable_override=enable_override)
self.continue_b.clicked.connect(lambda checked, self=weakref.ref(self): self().ok.emit(None))
def start(self, recipe=None, step=None):
super().start(recipe=recipe, step=step)
if self.run_once is True and self.done is True and self.done_ok is True:
return
self.visualize()
# TESTING
if "--test" in sys.argv:
self.test_timer = QTimer()
self.test_timer.setSingleShot(True)
self.test_timer.timeout.connect(self.continue_b.click)
self.test_timer.start(500)
# /TESTING
# def stop(self):
# super().stop()
# def reset(self):
# super().reset()