Commit | Line | Data |
---|---|---|
d68aeda7 FC |
1 | from ya2.utils.log import LogManager |
2 | LogManager.before_init_setup('pmachines') | |
3cc94ef6 | 3 | from sys import argv |
9199c6aa | 4 | from ya2.utils.gui.gui import GuiTools |
bf77b5d5 | 5 | if '--version' in argv: GuiTools.no_window() |
8ee66edd | 6 | from os.path import exists |
3cc94ef6 | 7 | from p3d_appimage import AppImageBuilder |
07a1eaf3 | 8 | from pmachines.application.application import Pmachines |
bb7e9b19 | 9 | from traceback import print_exc |
8ee66edd | 10 | |
aad6ced2 FC |
11 | |
12 | class Main: | |
13 | ||
14 | def __init__(self): | |
15 | self.__pmachines = Pmachines() | |
d6c157a0 | 16 | self.__appimage_builder = AppImageBuilder(None, 'pmachines') |
aad6ced2 FC |
17 | |
18 | def run(self): | |
d6c157a0 | 19 | if self.__pmachines.is_update_run: self.__appimage_builder.update() |
aad6ced2 FC |
20 | elif not self.__pmachines.is_version_run: self.__run_game() |
21 | ||
22 | def __run_game(self): | |
23 | try: self.__pmachines.run() | |
bb7e9b19 | 24 | except Exception: print_exc() |
aad6ced2 FC |
25 | |
26 | ||
8ee66edd | 27 | if __name__ == '__main__' or exists('main.pyo'): |
aad6ced2 | 28 | Main().run() |