Exemplo n.º 1
0
def test_answer():
    api = APIReader()
    api.update()

    assert len(api.active_mission_details) > 1
    for mission in api.active_mission_details:
        assert len(mission) == 4
Exemplo n.º 2
0
class APIThread(QThread):
    def __init__(self, gui):
        QThread.__init__(self)
        self.api = APIReader(gui=gui)

    def __del__(self):
        self.api.cancel_event()
        self.wait()

    def run(self):
        self.api.run(blocking=False)
Exemplo n.º 3
0
    def init_threads(self):
        self.ocr_thread = OCRThread(self.window)
        self.window.set_ocr_connection(self.ocr_thread.ocr)
        self.ocr_thread.start()

        api = APIReader(gui=self.window)
        self.api_thread = APIThread(self.window)
        self.window.set_api(api)
        self.api_thread.start()
        self.market_api = self.window.market_api
Exemplo n.º 4
0
    def run(self):
        app = ApplicationContext()
        window = Window()
        app.app.setWindowIcon(QIcon(window.icon_path))
        dark_stylesheet = qdarkstyle.load_stylesheet_pyqt5()
        app.app.setStyleSheet(dark_stylesheet)

        ocr_thread = OCRThread(window)
        window.set_ocr_connection(ocr_thread.ocr)
        ocr_thread.start()

        api = APIReader(gui=window)
        api_thread = APIThread(window)
        window.set_api(api)
        api_thread.start()

        market_api = window.market_api
        exit_code = app.app.exec_()
        ocr_thread.ocr.exit_now = True
        market_api.exit_now = True
        ocr_thread.terminate()
        api_thread.terminate()
        return exit_code
Exemplo n.º 5
0
 def __init__(self, gui):
     QThread.__init__(self)
     self.api = APIReader(gui=gui)