rrpamwds.py 文件源码

python
阅读 16 收藏 0 点赞 0 评论 0

项目:RRPam-WDS 作者: asselapathirana 项目源码 文件源码
def main(argv=[]):

    currentExitCode = EXIT_CODE_REBOOT
    while currentExitCode == EXIT_CODE_REBOOT:

        app = QApplication([])

        if getattr(sys, 'frozen', False):
            # frozen
            dir_ = os.path.dirname(sys.executable)
        else:
            # unfrozen
            dir_ = os.path.dirname(os.path.realpath(__file__))

        # IMG_PATH = IMG_PATH.append(os.path.join(dir_, 'images'))

        # Create and display the splash screen
        splash_pix = QPixmap(os.path.join(dir_, './rrpam_wds/gui/images/splash_screen.png'))
        if (splash_pix is None):
            pass
        splash = QSplashScreen(splash_pix, Qt.WindowStaysOnTopHint)
        # splash.setMask(splash_pix.mask())
        splash.show()
        import time
        start = time.time()

        while time.time() - start < .5:
            time.sleep(0.001)
            app.processEvents()

        from rrpam_wds.gui.dialogs import MainWindow

        from guidata.configtools import get_icon

        app.setWindowIcon(get_icon("main_logo.png"))
        if (len(argv) > 1 and argv[1] == TESTARG):  # pragma: no cover
            # first run tests

            win = MainWindow()
            import rrpam_wds.tests.test_optimal_time_graph as og
            og.main(og.TC, test=False, mainwindow=win)
            win = None

            win = MainWindow()
            import rrpam_wds.tests.test_main_window as mw
            mw.main(mw.TC, test=False, mainwindow=win)
            win = None

            time.sleep(3)
            app.processEvents()
            time.sleep(1)

        win = MainWindow()
        win.show()
        if(splash):
            splash.finish(win)
        splash = None
        currentExitCode = app.exec_()
        app = None
        time.sleep(0.1)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号