Commit | Line | Data |
---|---|---|
997664d8 FC |
1 | from ya2.utils.log import LogMgrBase |
2 | LogMgrBase.pre_init_logging() | |
3cc94ef6 | 3 | from sys import argv |
aad6ced2 FC |
4 | from ya2.p3d.gfx import P3dGfxMgr |
5 | if '--version' in argv: P3dGfxMgr.no_window() | |
8ee66edd | 6 | from os.path import exists |
3cc94ef6 | 7 | from traceback import print_exc |
3cc94ef6 | 8 | from p3d_appimage import AppImageBuilder |
997664d8 | 9 | from pmachines.app import Pmachines |
8ee66edd | 10 | |
aad6ced2 FC |
11 | |
12 | class Main: | |
13 | ||
14 | def __init__(self): | |
15 | self.__pmachines = Pmachines() | |
16 | ||
17 | def run(self): | |
18 | if self.__pmachines.is_update_run: AppImageBuilder('pmachines').update() | |
19 | elif not self.__pmachines.is_version_run: self.__run_game() | |
20 | ||
21 | def __run_game(self): | |
22 | try: self.__pmachines.run() | |
23 | except Exception: print_exc() | |
24 | ||
25 | ||
8ee66edd | 26 | if __name__ == '__main__' or exists('main.pyo'): |
aad6ced2 | 27 | Main().run() |