diff --git a/main.py b/main.py index cbb8e20..646d592 100644 --- a/main.py +++ b/main.py @@ -4,10 +4,10 @@ import module.resources from PySide6.QtWidgets import QApplication from ui.main import MainWindow -from utils.function import DEVELOPMENT_ENV +from utils.function import RELEASE_ENV if __name__ == '__main__': - if DEVELOPMENT_ENV: + if RELEASE_ENV: import pyi_splash pyi_splash.update_text('正在启动...') diff --git a/ui/main.py b/ui/main.py index d60ccb3..d71bd46 100644 --- a/ui/main.py +++ b/ui/main.py @@ -7,7 +7,7 @@ from ui.pyui.achievement_ui import AchievementWidget from ui.pyui.defense_ui import DefenseWidget from ui.pyui.picker_ui import PickerWidget from ui.pyui.test_ui import TestWidget -from utils.function import DEVELOPMENT_ENV +from utils.function import RELEASE_ENV class MainWindow(MSFluentWindow): @@ -21,7 +21,7 @@ class MainWindow(MSFluentWindow): self.defenseInterface = DefenseWidget('Defense Interface', self) self.aboutInterface = AboutWidget('About Interface', self) self.pickerInterface = PickerWidget('Picker Interface', self) - if not DEVELOPMENT_ENV: + if not RELEASE_ENV: self.testInterface = TestWidget('Test Interface', self) self.achievementInterface.error.connect(self.showError) @@ -35,7 +35,7 @@ class MainWindow(MSFluentWindow): self.addSubInterface(self.achievementInterface, FluentIcon.SPEED_HIGH, '达成度') self.addSubInterface(self.defenseInterface, FluentIcon.FEEDBACK, '答辩题目') self.addSubInterface(self.pickerInterface, FluentIcon.PEOPLE, '提问') - if not DEVELOPMENT_ENV: + if not RELEASE_ENV: self.addSubInterface(self.testInterface, FluentIcon.VIEW, '测试') self.addSubInterface(self.aboutInterface, FluentIcon.INFO, '关于', position=NavigationItemPosition.BOTTOM) @@ -53,7 +53,7 @@ class MainWindow(MSFluentWindow): def showEvent(self, event: QShowEvent): super().showEvent(event) - if DEVELOPMENT_ENV: + if RELEASE_ENV: import pyi_splash pyi_splash.update_text('正在加载...') pyi_splash.close() diff --git a/utils/function.py b/utils/function.py index ce6f12d..009d37a 100644 --- a/utils/function.py +++ b/utils/function.py @@ -222,4 +222,4 @@ def open_template(file_name: str, widget: QWidget) -> None: ) -DEVELOPMENT_ENV = getattr(sys, 'frozen', False) +RELEASE_ENV = getattr(sys, 'frozen', False)